Skip to content

Commit

Permalink
altera_qspi: set fail_addr for erase ops
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
hippo5329 committed Dec 28, 2015
1 parent 9e957aa commit a1b1d7e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/mtd/altera_qspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a1b1d7e

Please sign in to comment.