aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBaruch Siach <baruch@tkos.co.il>2010-08-09 00:20:23 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2010-10-24 18:26:13 -0400
commit12c8eb98de747ebc08404e3719c40abb405994e2 (patch)
treee48ab66a3f6578a05fe83a3d099a7d0f7b04a0d2
parent899611ee7d373e5eeda08e9a8632684e1ebbbf00 (diff)
mtd: fix callback return value check
Drivers may (and do) return negative errno values other than -1 from the ecc.correct callback. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
-rw-r--r--drivers/mtd/nand/nand_base.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index d551ddd9537..0fd22cce0ec 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -1223,7 +1223,7 @@ static int nand_read_subpage(struct mtd_info *mtd, struct nand_chip *chip, uint3
1223 int stat; 1223 int stat;
1224 1224
1225 stat = chip->ecc.correct(mtd, p, &chip->buffers->ecccode[i], &chip->buffers->ecccalc[i]); 1225 stat = chip->ecc.correct(mtd, p, &chip->buffers->ecccode[i], &chip->buffers->ecccalc[i]);
1226 if (stat == -1) 1226 if (stat < 0)
1227 mtd->ecc_stats.failed++; 1227 mtd->ecc_stats.failed++;
1228 else 1228 else
1229 mtd->ecc_stats.corrected += stat; 1229 mtd->ecc_stats.corrected += stat;