mtd: spi-nor-core: Try cleaning up in case writing BAR failed
Use the cleanup codepath of spi_nor_erase() also in the event of failure of writing the BAR register. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com> Reviewed-by: Pratyush Yadav <p.yadav@ti.com> Tested-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
This commit is contained in:
parent
e66c6f1027
commit
36384f612d
1 changed files with 1 additions and 1 deletions
|
@ -929,7 +929,7 @@ static int spi_nor_erase(struct mtd_info *mtd, struct erase_info *instr)
|
|||
#ifdef CONFIG_SPI_FLASH_BAR
|
||||
ret = write_bar(nor, addr);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
goto erase_err;
|
||||
#endif
|
||||
write_enable(nor);
|
||||
|
||||
|
|
Loading…
Reference in a new issue