From: Thomas Chou <thomas@wytron.com.tw>
Date: Wed, 23 Dec 2015 13:06:12 +0000 (+0800)
Subject: altera_qspi: set fail_addr for erase ops
X-Git-Tag: v2025.01-rc5-pxa1908~10829
X-Git-Url: http://git.dujemihanovic.xyz/html/static/git-logo.png?a=commitdiff_plain;h=a1b1d7eceb033c256ae661d65732323809fb9101;p=u-boot.git

altera_qspi: set fail_addr for erase ops

If the erase fails, fail_addr might indicate exactly which block
failed. If fail_addr = MTD_FAIL_ADDR_UNKNOWN, the failure was not
at the device level or was not specific to any particular block.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
---

diff --git a/drivers/mtd/altera_qspi.c b/drivers/mtd/altera_qspi.c
index 627a8ccee3..b0d4f2c810 100644
--- a/drivers/mtd/altera_qspi.c
+++ b/drivers/mtd/altera_qspi.c
@@ -145,6 +145,7 @@ static int altera_qspi_erase(struct mtd_info *mtd, struct erase_info *instr)
 			/* erase failed, sector might be protected */
 			debug("erase %08x fail %x\n", sect, stat);
 			writel(stat, &regs->isr); /* clear isr */
+			instr->fail_addr = addr;
 			instr->state = MTD_ERASE_FAILED;
 			mtd_erase_callback(instr);
 			return -EIO;