mtd/drivers/mtd/nand nand_base.c,1.105,1.106

gleixner at infradead.org gleixner at infradead.org
Tue Jun 22 05:30:06 EDT 2004


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

Modified Files:
	nand_base.c 
Log Message:
Support placeonly ecc mode

Index: nand_base.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/nand/nand_base.c,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -r1.105 -r1.106
--- nand_base.c	18 Jun 2004 16:22:42 -0000	1.105
+++ nand_base.c	22 Jun 2004 09:30:03 -0000	1.106
@@ -1206,7 +1206,7 @@
 			 * This is the legacy mode. Used by YAFFS1
 			 * Should go away some day
 			 */
-			if (oob_buf && oobsel->useecc != MTD_NANDECC_AUTOPLACE) { 
+			if (oob_buf && oobsel->useecc == MTD_NANDECC_PLACE) { 
 				int *p = (int *)(&oob_data[mtd->oobsize]);
 				p[i] = ecc_status;
 			}
@@ -1221,9 +1221,8 @@
 		/* check, if we have a fs supplied oob-buffer */
 		if (oob_buf) {
 			/* without autoplace. Legacy mode used by YAFFS1 */
-			if (oobsel->useecc != MTD_NANDECC_AUTOPLACE) {
-				oob_data += mtd->oobsize + this->eccsteps * sizeof (int);
-			} else {
+			switch(oobsel->useecc) {
+			case MTD_NANDECC_AUTOPLACE:
 				/* Walk through the autoplace chunks */
 				for (i = 0, j = 0; j < mtd->oobavail; i++) {
 					int from = oobsel->oobfree[i][0];
@@ -1232,6 +1231,12 @@
 					j+= num;
 				}
 				oob += mtd->oobavail;
+				break;
+			case MTD_NANDECC_PLACE:
+				/* YAFFS1 legacy mode */
+				oob_data += this->eccsteps * sizeof (int);
+			default:
+				oob_data += mtd->oobsize;
 			}
 		}
 	readdata:





More information about the linux-mtd-cvs mailing list