[MTD] [NAND] make s3c2410 indicate an error for multi-bit read errors
authorMatt Reimer <mreimer@vpop.net>
Fri, 19 Oct 2007 01:02:44 +0000 (18:02 -0700)
committerDavid Woodhouse <dwmw2@infradead.org>
Sat, 12 Jan 2008 14:46:31 +0000 (14:46 +0000)
If there were multiple bit errors in the data s3c2410_nand_correct_data()
was returning 0 (no error) instead of -1, so the upper layers (like JFFS2)
would not know the data is corrupt.

Signed-off-by: Matt Reimer <mreimer@vpop.net>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
drivers/mtd/nand/s3c2410.c

index 512acfc89012ca962915e870f0a0957c0e1f41ec..21a2cc8636dff07e86eb6b4b84b6457f981e44d7 100644 (file)
@@ -401,7 +401,7 @@ static int s3c2410_nand_correct_data(struct mtd_info *mtd, u_char *dat,
        if ((diff0 & ~(1<<fls(diff0))) == 0)
                return 1;
 
-       return 0;
+       return -1;
 }
 
 /* ECC functions