Skip to contentSkip to conversation

sf: call callback even if the mtd erase failed

PATCH New Thomas Chou 1 participant 1 message Dec 24, 2015 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sf: call callback even if the mtd erase failed

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

---
 drivers/mtd/spi/sf_mtd.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mtd/spi/sf_mtd.c +1 -0
index 0b9cb62..6140a35 100644
@@ -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;
 	}
 
Signature · 1 line
2.5.0