mtd/drivers/mtd/nand nand.c,1.30,1.31

gleixner at infradead.org gleixner at infradead.org
Wed Sep 4 07:19:36 EDT 2002


Update of /home/cvs/mtd/drivers/mtd/nand
In directory phoenix.infradead.org:/tmp/cvs-serv22387

Modified Files:
	nand.c 
Log Message:
fixed write-verify. Maybe I should turn on this switch from time to time :)

Index: nand.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/nand/nand.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- nand.c	29 Aug 2002 21:44:14 -0000	1.30
+++ nand.c	4 Sep 2002 11:19:33 -0000	1.31
@@ -100,6 +100,8 @@
  *		in one go together with the raw data. ECC codes are
  *		filled in at the place selected by oobsel.
  *
+ *  09-04-2002  tglx: fixed write_verify (John Hall (john.hall at optionexist.co.uk))
+ *
  * $Id$
  *
  * This program is free software; you can redistribute it and/or modify
@@ -491,10 +493,11 @@
 			if (oob_data[i] != readb (this->IO_ADDR_R)) {
 				DEBUG (MTD_DEBUG_LEVEL0, "nand_write_ecc: " "Failed write verify, page 0x%08x ", page);
 				return -EIO;
+			}
 		}
 	} else {
-		if (eccmode != NAND_ECC_NONE && !col && last == this->oobblock) {
-			int ecc_bytes;
+		if (eccmode != NAND_ECC_NONE && !col && last == mtd->oobblock) {
+			int ecc_bytes = 0;
 
 			switch (this->eccmode) {
 			case NAND_ECC_SOFT:
@@ -504,10 +507,10 @@
 			}
 
 			for (i = 0; i < mtd->oobsize; i++)
-				oob_data = readb (this->IO_ADDR_R);
+				oob_data[i] = readb (this->IO_ADDR_R);
 
 			for (i = 0; i < ecc_bytes; i++) {
-				if (oob_data[oob_config.ecc_pos[i]] != ecc_code[i])) {
+				if (oob_data[oob_config[i]] != ecc_code[i]) {
 					DEBUG (MTD_DEBUG_LEVEL0,
 					       "nand_write_ecc: Failed ECC write "
 				       "verify, page 0x%08x, " "%6i bytes were succesful\n", page, i);





More information about the linux-mtd-cvs mailing list