mtd: utilize `mtd_is_*()' functions
Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
This commit is contained in:
committed by
Artem Bityutskiy
parent
7387ce7732
commit
d57f40544a
@@ -95,10 +95,10 @@ concat_read(struct mtd_info *mtd, loff_t from, size_t len,
|
||||
|
||||
/* Save information about bitflips! */
|
||||
if (unlikely(err)) {
|
||||
if (err == -EBADMSG) {
|
||||
if (mtd_is_eccerr(err)) {
|
||||
mtd->ecc_stats.failed++;
|
||||
ret = err;
|
||||
} else if (err == -EUCLEAN) {
|
||||
} else if (mtd_is_bitflip(err)) {
|
||||
mtd->ecc_stats.corrected++;
|
||||
/* Do not overwrite -EBADMSG !! */
|
||||
if (!ret)
|
||||
@@ -279,10 +279,10 @@ concat_read_oob(struct mtd_info *mtd, loff_t from, struct mtd_oob_ops *ops)
|
||||
|
||||
/* Save information about bitflips! */
|
||||
if (unlikely(err)) {
|
||||
if (err == -EBADMSG) {
|
||||
if (mtd_is_eccerr(err)) {
|
||||
mtd->ecc_stats.failed++;
|
||||
ret = err;
|
||||
} else if (err == -EUCLEAN) {
|
||||
} else if (mtd_is_bitflip(err)) {
|
||||
mtd->ecc_stats.corrected++;
|
||||
/* Do not overwrite -EBADMSG !! */
|
||||
if (!ret)
|
||||
|
Reference in New Issue
Block a user