From: Thomas Chou Date: Wed, 23 Dec 2015 02:26:03 +0000 (+0800) Subject: altera_qspi: call callback even if the erase failed X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=9e957aa4ce959faa89d31bc3ff401cc08bbc1013;p=u-boot.git altera_qspi: call callback even if the 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. Signed-off-by: Thomas Chou --- diff --git a/drivers/mtd/altera_qspi.c b/drivers/mtd/altera_qspi.c index c7e37add01..627a8ccee3 100644 --- a/drivers/mtd/altera_qspi.c +++ b/drivers/mtd/altera_qspi.c @@ -146,6 +146,7 @@ static int altera_qspi_erase(struct mtd_info *mtd, struct erase_info *instr) debug("erase %08x fail %x\n", sect, stat); writel(stat, ®s->isr); /* clear isr */ instr->state = MTD_ERASE_FAILED; + mtd_erase_callback(instr); return -EIO; } addr += mtd->erasesize;