Commit d4094661 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Thomas Gleixner

[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: default avatarThomas Gleixner <tglx@linutronix.de>
parent 2c92d755
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
* The AG-AND chips have nice features for speed improvement, * The AG-AND chips have nice features for speed improvement,
* which are not supported yet. Read / program 4 pages in one go. * which are not supported yet. Read / program 4 pages in one go.
* *
* $Id: nand_base.c,v 1.147 2005/07/15 07:18:06 gleixner Exp $ * $Id: nand_base.c,v 1.148 2005/08/04 17:14:48 gleixner Exp $
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as * 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,7 +2369,7 @@ int nand_scan (struct mtd_info *mtd, int maxchips)
mtd->oobblock = 1024 << (extid & 0x3); mtd->oobblock = 1024 << (extid & 0x3);
extid >>= 2; extid >>= 2;
/* Calc oobsize */ /* Calc oobsize */
mtd->oobsize = (8 << (extid & 0x03)) * (mtd->oobblock / 512); mtd->oobsize = (8 << (extid & 0x01)) * (mtd->oobblock >> 9);
extid >>= 2; extid >>= 2;
/* Calc blocksize. Blocksize is multiples of 64KiB */ /* Calc blocksize. Blocksize is multiples of 64KiB */
mtd->erasesize = (64 * 1024) << (extid & 0x03); mtd->erasesize = (64 * 1024) << (extid & 0x03);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment