[MTD] OneNAND: return ecc error code only when 2-bit ecc occurs
authorKyungmin Park <kyungmin.park@samsung.com>
Fri, 5 Jan 2007 10:16:04 +0000 (19:16 +0900)
committerArtem Bityutskiy <dedekind@infradead.org>
Wed, 10 Jan 2007 13:04:28 +0000 (15:04 +0200)
we don't need to return ecc error when 1-bit ecc.
We only return error code when 2-bit ecc error

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
drivers/mtd/onenand/onenand_base.c

index abbe160b43092fff9623b4e72e4e56ee2aa16d4c..2ea07f5723d171b52ed10c614a60072bc975670b 100644 (file)
@@ -327,12 +327,12 @@ static int onenand_wait(struct mtd_info *mtd, int state)
                int ecc = this->read_word(this->base + ONENAND_REG_ECC_STATUS);
                if (ecc) {
                        DEBUG(MTD_DEBUG_LEVEL0, "onenand_wait: ECC error = 0x%04x\n", ecc);
-                       if (ecc & ONENAND_ECC_2BIT_ALL)
+                       if (ecc & ONENAND_ECC_2BIT_ALL) {
                                mtd->ecc_stats.failed++;
-                       else if (ecc & ONENAND_ECC_1BIT_ALL)
+                               return ecc;
+                       } else if (ecc & ONENAND_ECC_1BIT_ALL)
                                mtd->ecc_stats.corrected++;
                }
-               return ecc;
        }
 
        return 0;