Message ID | 273cb4acaf14aaf63773c9dcb94e330b6f8f3bee.1506820067.git.engkhalil86@gmail.com |
---|---|
State | Superseded |
Delegated to: | Jagannadha Sutradharudu Teki |
Headers | show |
Series | Clear error flags & initialization of Spansion | expand |
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; }
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 <engkhalil86@gmail.com> --- drivers/mtd/spi/spi_flash.c | 3 +++ 1 file changed, 3 insertions(+)