summaryrefslogtreecommitdiff
path: root/drivers/mtd/altera_qspi.c
diff options
context:
space:
mode:
authorThomas Chou <thomas@wytron.com.tw>2015-12-23 21:06:12 +0800
committerThomas Chou <thomas@wytron.com.tw>2015-12-28 09:32:43 +0800
commita1b1d7eceb033c256ae661d65732323809fb9101 (patch)
tree7e759c0e00e5c932acb2cc0506829fe4c32054bc /drivers/mtd/altera_qspi.c
parent9e957aa4ce959faa89d31bc3ff401cc08bbc1013 (diff)
downloadu-boot-a1b1d7eceb033c256ae661d65732323809fb9101.tar.gz
u-boot-a1b1d7eceb033c256ae661d65732323809fb9101.tar.bz2
u-boot-a1b1d7eceb033c256ae661d65732323809fb9101.zip
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>
Diffstat (limited to 'drivers/mtd/altera_qspi.c')
-rw-r--r--drivers/mtd/altera_qspi.c1
1 files changed, 1 insertions, 0 deletions
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;