mtd/drivers/mtd/nand nand_base.c,1.100,1.101

gleixner at infradead.org gleixner at infradead.org
Wed Jun 16 19:47:09 EDT 2004


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

Modified Files:
	nand_base.c 
Log Message:
Read them to the correct place in case of a caller supplied read buffer

Index: nand_base.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/nand/nand_base.c,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -r1.100 -r1.101
--- nand_base.c	16 Jun 2004 23:26:20 -0000	1.100
+++ nand_base.c	16 Jun 2004 23:47:06 -0000	1.101
@@ -1164,11 +1164,11 @@
 					/* Some hw ecc generators need to know when the
 					 * syndrome is read from flash */
 					this->enable_hwecc(mtd, NAND_ECC_READSYN);
-					this->read_buf(mtd, &ecc_calc[i], eccbytes);
+					this->read_buf(mtd, &oob_buf[i], eccbytes);
 					/* We calc error correction directly, it checks the hw
 					 * generator for an error, reads back the syndrome and
 					 * does the error correction on the fly */
-					if (this->correct_data(mtd, &data_poi[datidx], &ecc_code[i], &ecc_calc[i]) == -1) {
+					if (this->correct_data(mtd, &data_poi[datidx], &ecc_code[i], &oob_buf[i]) == -1) {
 						DEBUG (MTD_DEBUG_LEVEL0, "nand_read_ecc: " "Failed ECC read, page 0x%08x\n", page);
 						ecc_failed++;
 					}
@@ -1183,7 +1183,7 @@
 		}
 
 		/* read oobdata */
-		this->read_buf(mtd, oob_data, oobreadlen);
+		this->read_buf(mtd, &oob_data[mtd->oobsize - oobreadlen], oobreadlen);
 
 		/* Skip ECC check, if not requested (ECC_NONE or HW_ECC with syndromes) */
 		if (!compareecc)





More information about the linux-mtd-cvs mailing list