[MTD] OneNAND: return ecc error code only when 2-bit ecc occurs

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Thu Jan 11 09:59:04 EST 2007


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=b3c9f8bfe7ab366a5d2495ebe5d2dc6fd7368122
Commit:     b3c9f8bfe7ab366a5d2495ebe5d2dc6fd7368122
Parent:     a8de85d557004d6d4e4cf79ecd6b97339b986fe9
Author:     Kyungmin Park <kyungmin.park at samsung.com>
AuthorDate: Fri Jan 5 19:16:04 2007 +0900
Committer:  Artem Bityutskiy <dedekind at infradead.org>
CommitDate: Wed Jan 10 15:04:28 2007 +0200

    [MTD] OneNAND: return ecc error code only when 2-bit ecc occurs
    
    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 at samsung.com>
---
 drivers/mtd/onenand/onenand_base.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index abbe160..2ea07f5 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -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;



More information about the linux-mtd-cvs mailing list