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/mtdconcat.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/mtdconcat.c')
-rw-r--r-- | drivers/mtd/mtdconcat.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c index d3fabd144d6c..6df4d4d4eb92 100644 --- a/drivers/mtd/mtdconcat.c +++ b/drivers/mtd/mtdconcat.c | |||
@@ -95,10 +95,10 @@ concat_read(struct mtd_info *mtd, loff_t from, size_t len, | |||
95 | 95 | ||
96 | /* Save information about bitflips! */ | 96 | /* Save information about bitflips! */ |
97 | if (unlikely(err)) { | 97 | if (unlikely(err)) { |
98 | if (err == -EBADMSG) { | 98 | if (mtd_is_eccerr(err)) { |
99 | mtd->ecc_stats.failed++; | 99 | mtd->ecc_stats.failed++; |
100 | ret = err; | 100 | ret = err; |
101 | } else if (err == -EUCLEAN) { | 101 | } else if (mtd_is_bitflip(err)) { |
102 | mtd->ecc_stats.corrected++; | 102 | mtd->ecc_stats.corrected++; |
103 | /* Do not overwrite -EBADMSG !! */ | 103 | /* Do not overwrite -EBADMSG !! */ |
104 | if (!ret) | 104 | if (!ret) |
@@ -279,10 +279,10 @@ concat_read_oob(struct mtd_info *mtd, loff_t from, struct mtd_oob_ops *ops) | |||
279 | 279 | ||
280 | /* Save information about bitflips! */ | 280 | /* Save information about bitflips! */ |
281 | if (unlikely(err)) { | 281 | if (unlikely(err)) { |
282 | if (err == -EBADMSG) { | 282 | if (mtd_is_eccerr(err)) { |
283 | mtd->ecc_stats.failed++; | 283 | mtd->ecc_stats.failed++; |
284 | ret = err; | 284 | ret = err; |
285 | } else if (err == -EUCLEAN) { | 285 | } else if (mtd_is_bitflip(err)) { |
286 | mtd->ecc_stats.corrected++; | 286 | mtd->ecc_stats.corrected++; |
287 | /* Do not overwrite -EBADMSG !! */ | 287 | /* Do not overwrite -EBADMSG !! */ |
288 | if (!ret) | 288 | if (!ret) |