mtd: utilize `mtd_is_*()' functions
[pandora-kernel.git] / drivers / mtd / ubi / scan.c
index a3a198f..0cb17d9 100644 (file)
@@ -395,7 +395,7 @@ static int compare_lebs(struct ubi_device *ubi, const struct ubi_scan_leb *seb,
        }
 
        err = ubi_io_read_data(ubi, buf, pnum, 0, len);
-       if (err && err != UBI_IO_BITFLIPS && err != -EBADMSG)
+       if (err && err != UBI_IO_BITFLIPS && !mtd_is_eccerr(err))
                goto out_free_buf;
 
        data_crc = be32_to_cpu(vid_hdr->data_crc);
@@ -793,7 +793,7 @@ static int check_corruption(struct ubi_device *ubi, struct ubi_vid_hdr *vid_hdr,
 
        err = ubi_io_read(ubi, ubi->peb_buf1, pnum, ubi->leb_start,
                          ubi->leb_size);
-       if (err == UBI_IO_BITFLIPS || err == -EBADMSG) {
+       if (err == UBI_IO_BITFLIPS || mtd_is_eccerr(err)) {
                /*
                 * Bit-flips or integrity errors while reading the data area.
                 * It is difficult to say for sure what type of corruption is