If writing fail, error that is flagged into status
register-1 should be cleared. Otherwise, next
operation(s) may be done incorrectly/incomplete.

Signed-off-by: Ahmed S. Khalil <[email protected]>
---
 drivers/mtd/spi/spi_flash.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 6f54e10..b6b56fe 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -415,6 +415,9 @@ int spi_flash_cmd_write_ops(struct spi_flash *flash, u32 
offset,
                                        buf + actual, chunk_len);
                if (ret < 0) {
                        debug("SF: write failed\n");
+#ifdef CONFIG_SPI_FLASH_SPANSION
+                       clear_sr(flash);
+#endif
                        break;
                }
 
-- 
2.7.4

_______________________________________________
U-Boot mailing list
[email protected]
https://lists.denx.de/listinfo/u-boot

Reply via email to