aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2005-08-11 13:13:46 -0400
committerThomas Gleixner <tglx@mtd.linutronix.de>2005-11-06 14:22:32 -0500
commitd4094661545662982278900220729982372b0e9a (patch)
tree845c22d703c1f894fbfe76367e1f9820b1e278f0
parent2c92d755323514a12c367f52027fb1f53328fcd6 (diff)
[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 Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--drivers/mtd/nand/nand_base.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 04e54318bc6a..cdf108619344 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -59,7 +59,7 @@
59 * The AG-AND chips have nice features for speed improvement, 59 * The AG-AND chips have nice features for speed improvement,
60 * which are not supported yet. Read / program 4 pages in one go. 60 * which are not supported yet. Read / program 4 pages in one go.
61 * 61 *
62 * $Id: nand_base.c,v 1.147 2005/07/15 07:18:06 gleixner Exp $ 62 * $Id: nand_base.c,v 1.148 2005/08/04 17:14:48 gleixner Exp $
63 * 63 *
64 * This program is free software; you can redistribute it and/or modify 64 * This program is free software; you can redistribute it and/or modify
65 * it under the terms of the GNU General Public License version 2 as 65 * it under the terms of the GNU General Public License version 2 as
@@ -2369,7 +2369,7 @@ int nand_scan (struct mtd_info *mtd, int maxchips)
2369 mtd->oobblock = 1024 << (extid & 0x3); 2369 mtd->oobblock = 1024 << (extid & 0x3);
2370 extid >>= 2; 2370 extid >>= 2;
2371 /* Calc oobsize */ 2371 /* Calc oobsize */
2372 mtd->oobsize = (8 << (extid & 0x03)) * (mtd->oobblock / 512); 2372 mtd->oobsize = (8 << (extid & 0x01)) * (mtd->oobblock >> 9);
2373 extid >>= 2; 2373 extid >>= 2;
2374 /* Calc blocksize. Blocksize is multiples of 64KiB */ 2374 /* Calc blocksize. Blocksize is multiples of 64KiB */
2375 mtd->erasesize = (64 * 1024) << (extid & 0x03); 2375 mtd->erasesize = (64 * 1024) << (extid & 0x03);