mtd/drivers/mtd/nand nand_base.c,1.147,1.148

gleixner at infradead.org gleixner at infradead.org
Thu Aug 4 13:14:52 EDT 2005


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

Modified Files:
	nand_base.c 
Log Message:
[MTD] NAND: Use correct mask for OOB size calculation

The bit mask used for oob size calculation was using 2 bits instead
of one. Fortunately the next bit has been 0 all the time.

Thanks to Nathan H. for pointing this out



Index: nand_base.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/nand/nand_base.c,v
retrieving revision 1.147
retrieving revision 1.148
diff -u -r1.147 -r1.148
--- nand_base.c	15 Jul 2005 07:18:06 -0000	1.147
+++ nand_base.c	4 Aug 2005 17:14:48 -0000	1.148
@@ -2368,7 +2368,7 @@
 			mtd->oobblock = 1024 << (extid & 0x3);
 			extid >>= 2;
 			/* Calc oobsize */
-			mtd->oobsize = (8 << (extid & 0x03)) * (mtd->oobblock / 512);
+			mtd->oobsize = (8 << (extid & 0x01)) * (mtd->oobblock >> 9);
 			extid >>= 2;
 			/* Calc blocksize. Blocksize is multiples of 64KiB */
 			mtd->erasesize = (64 * 1024)  << (extid & 0x03);
@@ -2651,6 +2651,9 @@
 	memcpy(&mtd->oobinfo, this->autooob, sizeof(mtd->oobinfo));
 
 	mtd->owner = THIS_MODULE;
+
+	/* Reset the chip */
+	this->cmdfunc (mtd, NAND_CMD_RESET, -1, -1);
 	
 	/* Check, if we should skip the bad block table scan */
 	if (this->options & NAND_SKIP_BBTSCAN)





More information about the linux-mtd-cvs mailing list