diff options
author | Brian Norris <computersforpeace@gmail.com> | 2011-09-20 21:34:25 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@intel.com> | 2011-09-21 02:19:06 -0400 |
commit | d57f40544a41fdfe90fd863b6865138c5a82f1cc (patch) | |
tree | 4d5e8f6d0a62e8fa06ccfabd13fe9364b19db1b5 /drivers/mtd/mtdchar.c | |
parent | 7387ce773256f446bdd0280b2449b635441f906e (diff) |
mtd: utilize `mtd_is_*()' functions
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
Diffstat (limited to 'drivers/mtd/mtdchar.c')
-rw-r--r-- | drivers/mtd/mtdchar.c | 4 |
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; |