aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/mtdchar.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/mtdchar.c')
-rw-r--r--drivers/mtd/mtdchar.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index 8feb5fdcd97b..47be6e5cefe4 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -242,7 +242,7 @@ static ssize_t mtd_read(struct file *file, char __user *buf, size_t count,loff_t
242 * Userspace software which accesses NAND this way 242 * Userspace software which accesses NAND this way
243 * must be aware of the fact that it deals with NAND 243 * must be aware of the fact that it deals with NAND
244 */ 244 */
245 if (!ret || (ret == -EUCLEAN) || (ret == -EBADMSG)) { 245 if (!ret || mtd_is_bitflip_or_eccerr(ret)) {
246 *ppos += retlen; 246 *ppos += retlen;
247 if (copy_to_user(buf, kbuf, retlen)) { 247 if (copy_to_user(buf, kbuf, retlen)) {
248 kfree(kbuf); 248 kfree(kbuf);
@@ -491,7 +491,7 @@ static int mtd_do_readoob(struct file *file, struct mtd_info *mtd,
491 * does not calculate ECC for the OOB area, so do not rely on 491 * does not calculate ECC for the OOB area, so do not rely on
492 * this behavior unless you have replaced it with your own. 492 * this behavior unless you have replaced it with your own.
493 */ 493 */
494 if (ret == -EUCLEAN || ret == -EBADMSG) 494 if (mtd_is_bitflip_or_eccerr(ret))
495 return 0; 495 return 0;
496 496
497 return ret; 497 return ret;