aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/scan.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-09-02 18:30:16 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-10-19 10:19:56 -0400
commit756e1df1d2b8b572a92dd1b82d2a432d5b280b1c (patch)
treee1109e8a31f72bb3c50b2001f28983c1bdfba1a9 /drivers/mtd/ubi/scan.c
parentc174a08c72ae77a05be59d0d810dc13239b81e8e (diff)
UBI: rename IO error code
Rename UBI_IO_BAD_HDR_READ into UBI_IO_BAD_HDR_EBADMSG which is presumably more self-documenting and readable. Indeed, the '_READ' suffix does not tell much and even confuses, while '_EBADMSG' tells about uncorrectable ECC error, because we use -EBADMSG all over the place to represent ECC errors. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi/scan.c')
-rw-r--r--drivers/mtd/ubi/scan.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c
index 69b52e9c9489..7e7c56d162ec 100644
--- a/drivers/mtd/ubi/scan.c
+++ b/drivers/mtd/ubi/scan.c
@@ -750,7 +750,7 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si,
750 bitflips = 1; 750 bitflips = 1;
751 else if (err == UBI_IO_PEB_EMPTY) 751 else if (err == UBI_IO_PEB_EMPTY)
752 return add_to_list(si, pnum, UBI_SCAN_UNKNOWN_EC, &si->erase); 752 return add_to_list(si, pnum, UBI_SCAN_UNKNOWN_EC, &si->erase);
753 else if (err == UBI_IO_BAD_HDR_READ || err == UBI_IO_BAD_HDR) { 753 else if (err == UBI_IO_BAD_HDR_EBADMSG || err == UBI_IO_BAD_HDR) {
754 /* 754 /*
755 * We have to also look at the VID header, possibly it is not 755 * We have to also look at the VID header, possibly it is not
756 * corrupted. Set %bitflips flag in order to make this PEB be 756 * corrupted. Set %bitflips flag in order to make this PEB be
@@ -816,11 +816,11 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si,
816 return err; 816 return err;
817 else if (err == UBI_IO_BITFLIPS) 817 else if (err == UBI_IO_BITFLIPS)
818 bitflips = 1; 818 bitflips = 1;
819 else if (err == UBI_IO_BAD_HDR_READ || err == UBI_IO_BAD_HDR || 819 else if (err == UBI_IO_BAD_HDR_EBADMSG || err == UBI_IO_BAD_HDR ||
820 (err == UBI_IO_PEB_FREE && ec_corr)) { 820 (err == UBI_IO_PEB_FREE && ec_corr)) {
821 /* VID header is corrupted */ 821 /* VID header is corrupted */
822 if (err == UBI_IO_BAD_HDR_READ || 822 if (err == UBI_IO_BAD_HDR_EBADMSG ||
823 ec_corr == UBI_IO_BAD_HDR_READ) 823 ec_corr == UBI_IO_BAD_HDR_EBADMSG)
824 si->read_err_count += 1; 824 si->read_err_count += 1;
825 err = add_to_list(si, pnum, ec, &si->corr); 825 err = add_to_list(si, pnum, ec, &si->corr);
826 if (err) 826 if (err)