mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-11 07:34:31 +00: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
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
|
#ifdef CONFIG_SPI_FLASH_BAR
|
||||||
ret = write_bar(nor, addr);
|
ret = write_bar(nor, addr);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
goto erase_err;
|
||||||
#endif
|
#endif
|
||||||
write_enable(nor);
|
write_enable(nor);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue