aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/nand_base.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@cruncher.tec.linutronix.de>2006-05-29 14:56:39 +0200
committerThomas Gleixner <tglx@cruncher.tec.linutronix.de>2006-05-29 15:06:51 +0200
commit9a1fcdfd4bee27c418424cac47abf7c049541297 (patch)
tree5baa5f1e1d1a296a319bf6a5a4b636668c107e00 /drivers/mtd/nand/nand_base.c
parent[MTD] Rework the out of band handling completely (diff)
downloadlinux-dev-9a1fcdfd4bee27c418424cac47abf7c049541297.tar.xz
linux-dev-9a1fcdfd4bee27c418424cac47abf7c049541297.zip
[MTD] NAND Signal that a bitflip was corrected by ECC
Return -EUCLEAN on read when a bitflip was detected and corrected, so the clients can react and eventually copy the affected block to a spare one. Make all in kernel users aware of the change. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/mtd/nand/nand_base.c')
-rw-r--r--drivers/mtd/nand/nand_base.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index b8e6e1579cf1..7a3a44907715 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -1035,7 +1035,10 @@ static int nand_do_read_ops(struct mtd_info *mtd, loff_t from,
if (ret)
return ret;
- return mtd->ecc_stats.failed - stats.failed ? -EBADMSG : 0;
+ if (mtd->ecc_stats.failed - stats.failed)
+ return -EBADMSG;
+
+ return mtd->ecc_stats.corrected - stats.corrected ? -EUCLEAN : 0;
}
/**