Erase is an asynchronous operation.  Device drivers are supposed
to call instr->callback() whenever the operation completes, even
if it completes with a failure.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---
 drivers/mtd/spi/sf_mtd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/spi/sf_mtd.c b/drivers/mtd/spi/sf_mtd.c
index 0b9cb62..6140a35 100644
--- a/drivers/mtd/spi/sf_mtd.c
+++ b/drivers/mtd/spi/sf_mtd.c
@@ -24,6 +24,7 @@ static int spi_flash_mtd_erase(struct mtd_info *mtd, struct 
erase_info *instr)
        if (err) {
                instr->state = MTD_ERASE_FAILED;
                instr->fail_addr = MTD_FAIL_ADDR_UNKNOWN;
+               mtd_erase_callback(instr);
                return -EIO;
        }
 
-- 
2.5.0

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to