mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-13 20:36:02 +01:00
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
@ -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…
x
Reference in New Issue
Block a user