[MTD] OneNAND: fix onenand_wait bug in read ecc error

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


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=2fd32d4af83f4535d12d3f6dd23189352a9596fa
Commit:     2fd32d4af83f4535d12d3f6dd23189352a9596fa
Parent:     61a7e1983e773b93aac172dadc97f1eb484536b4
Author:     Kyungmin Park <kyungmin.park at samsung.com>
AuthorDate: Fri Dec 29 11:51:40 2006 +0900
Committer:  Artem Bityutskiy <dedekind at infradead.org>
CommitDate: Wed Jan 10 14:40:16 2007 +0200

    [MTD] OneNAND: fix onenand_wait bug in read ecc error
    
    Even though there is ECC error. OneNAND driver updates the buffram as valid
    
    Signed-off-by: Kyungmin Park <kyungmin.park at samsung.com>
---
 drivers/mtd/onenand/onenand_base.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index 0037cee..e80857b 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -298,7 +298,7 @@ static int onenand_wait(struct mtd_info *mtd, int state)
 	unsigned long timeout;
 	unsigned int flags = ONENAND_INT_MASTER;
 	unsigned int interrupt = 0;
-	unsigned int ctrl, ecc;
+	unsigned int ctrl;
 
 	/* The 20 msec is enough */
 	timeout = jiffies + msecs_to_jiffies(20);
@@ -324,7 +324,7 @@ static int onenand_wait(struct mtd_info *mtd, int state)
 	}
 
 	if (interrupt & ONENAND_INT_READ) {
-		ecc = this->read_word(this->base + ONENAND_REG_ECC_STATUS);
+		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)
@@ -332,6 +332,7 @@ static int onenand_wait(struct mtd_info *mtd, int state)
 			else if (ecc & ONENAND_ECC_1BIT_ALL)
 				mtd->ecc_stats.corrected++;
 		}
+		return ecc;
 	}
 
 	return 0;



More information about the linux-mtd-cvs mailing list