瀏覽代碼

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 <thomas@wytron.com.tw>
Thomas Chou 9 年之前
父節點
當前提交
9e957aa4ce
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/mtd/altera_qspi.c

+ 1 - 0
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, &regs->isr); /* clear isr */
 			instr->state = MTD_ERASE_FAILED;
+			mtd_erase_callback(instr);
 			return -EIO;
 		}
 		addr += mtd->erasesize;