[MTD] NAND: Missing fixups

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Wed Jun 21 08:59:01 EDT 2006


Commit:     0d420f9d6111b3a2fb7d5dd0180456eed469055d
Parent:     22ae813b85df7c0b0fc7c8d6f336d6a9f566ff97
commit 0d420f9d6111b3a2fb7d5dd0180456eed469055d
Author:     Savin Zlobec <tglx at cruncher.tec.linutronix.de>
AuthorDate: Wed Jun 21 11:51:20 2006 +0200
Commit:     David Woodhouse <dwmw2 at infradead.org>
CommitDate: Wed Jun 21 13:11:56 2006 +0100

    [MTD] NAND: Missing fixups
    
    The oob fixups broke a return value and missed one patch from
    the Mailing List.
    
    Signed-off-by: Savin Zlobec <savin at epico.si>
    Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
---
 drivers/mtd/nand/nand_base.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 27083ed..8df184f 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -1176,7 +1176,7 @@ static int nand_write_oob_std(struct mtd
 
 	status = chip->waitfunc(mtd, chip);
 
-	return status;
+	return status & NAND_STATUS_FAIL ? -EIO : 0;
 }
 
 /**
@@ -1271,10 +1271,6 @@ static int nand_do_read_oob(struct mtd_i
 		sndcmd = chip->ecc.read_oob(mtd, chip, page, sndcmd);
 		buf = nand_transfer_oob(chip, buf, ops);
 
-		readlen -= ops->ooblen;
-		if (!readlen)
-			break;
-
 		if (!(chip->options & NAND_NO_READRDY)) {
 			/*
 			 * Apply delay or wait for ready/busy pin. Do this
@@ -1288,6 +1284,10 @@ static int nand_do_read_oob(struct mtd_i
 				nand_wait_ready(mtd);
 		}
 
+		readlen -= ops->ooblen;
+		if (!readlen)
+			break;
+
 		/* Increment page address */
 		realpage++;
 



More information about the linux-mtd-cvs mailing list