]> err.no Git - linux-2.6/commitdiff
[MTD] nandsim: bugfix in page addressing
authorArtem Bityutskiy <dedekind@infradead.org>
Wed, 6 Dec 2006 19:52:32 +0000 (21:52 +0200)
committerDavid Woodhouse <dwmw2@infradead.org>
Fri, 8 Dec 2006 13:22:54 +0000 (13:22 +0000)
Number of address bytes for 64-128 MiB NANDs is 4, not 5.

Signed-off-by: Artem Bityutskiy <dedekind@infradead.org>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
drivers/mtd/nand/nandsim.c

index 3d39451ae8f5c113fa7ed4954f7c1789da601b33..c3bca9590ad21cbf65ca9f81e12d991c8e3a5203 100644 (file)
@@ -160,7 +160,7 @@ MODULE_PARM_DESC(dbg,            "Output debug information if not zero");
 /* After a command is input, the simulator goes to one of the following states */
 #define STATE_CMD_READ0        0x00000001 /* read data from the beginning of page */
 #define STATE_CMD_READ1        0x00000002 /* read data from the second half of page */
-#define STATE_CMD_READSTART      0x00000003 /* read data second command (large page devices) */
+#define STATE_CMD_READSTART    0x00000003 /* read data second command (large page devices) */
 #define STATE_CMD_PAGEPROG     0x00000004 /* start page programm */
 #define STATE_CMD_READOOB      0x00000005 /* read OOB area */
 #define STATE_CMD_ERASE1       0x00000006 /* sector erase first command */
@@ -440,7 +440,7 @@ static int init_nandsim(struct mtd_info *mtd)
                }
        } else {
                if (ns->geom.totsz <= (128 << 20)) {
-                       ns->geom.pgaddrbytes  = 5;
+                       ns->geom.pgaddrbytes  = 4;
                        ns->geom.secaddrbytes = 2;
                } else {
                        ns->geom.pgaddrbytes  = 5;