]> git.sur5r.net Git - u-boot/commitdiff
NAND: Update check condition for nand_read_page_hwecc API
authorSandeep Paulraj <s-paulraj@ti.com>
Sat, 7 Nov 2009 19:25:03 +0000 (14:25 -0500)
committerScott Wood <scottwood@freescale.com>
Fri, 13 Nov 2009 22:56:16 +0000 (16:56 -0600)
The patch updates the check condition for determining
whether the ECC corrections has failed.
This makes it similar to what is in the kernel NAND driver.

Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
drivers/mtd/nand/nand_base.c

index cfd582af9d5a2cef2fffbd8783a49863fc2955d8..52b0c1a762da5a5c2ef890bc39ade59247d7ef00 100644 (file)
@@ -1062,7 +1062,7 @@ static int nand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
                int stat;
 
                stat = chip->ecc.correct(mtd, p, &ecc_code[i], &ecc_calc[i]);
-               if (stat == -1)
+               if (stat < 0)
                        mtd->ecc_stats.failed++;
                else
                        mtd->ecc_stats.corrected += stat;