[PATCH][01/03] nandsim bugfix

Kluba Patrik pajko at kukac.halom.u-szeged.hu
Mon May 23 03:33:26 EDT 2005


Hi!

There are two bugs in nandsim. The first is in Kconfig. MTD_NAND_NANDSIM is 
defined as a bool value, so it can have a value of 'y' or be undefined. This way 
nandsim cannot be compiled as a module, it will directly go into the kernel.

The second bug is in nandsim.c. Large page chips <=128M use 4 bytes for 
addressing, not 5.

Here is a patch.

Bye,
   Patrik Kluba

--
diff -Naur mtd/drivers/mtd/nand/Kconfig mtd-work/drivers/mtd/nand/Kconfig
--- mtd/drivers/mtd/nand/Kconfig	2005-01-05 13:42:24.000000000 +0100
+++ mtd-work/drivers/mtd/nand/Kconfig	2005-05-23 07:43:43.000000000 +0200
@@ -197,11 +197,11 @@
   	depends on MTD_NAND	&& ARCH_PXA

   config MTD_NAND_NANDSIM
- 	bool "Support for NAND Flash Simulator"
- 	depends on MTD_NAND && MTD_PARTITIONS
+ 	tristate "Support for NAND Flash Simulator"
+ 	depends on m && MTD_NAND && MTD_PARTITIONS

  	help
  	  The simulator may simulate verious NAND flash chips for the
  	  MTD nand layer.
- 
+
  endmenu
diff -Naur mtd/drivers/mtd/nand/nandsim.c mtd-work/drivers/mtd/nand/nandsim.c
--- mtd/drivers/mtd/nand/nandsim.c	2005-03-19 16:33:56.000000000 +0100
+++ mtd-work/drivers/mtd/nand/nandsim.c	2005-05-23 07:48:34.000000000 +0200
@@ -406,7 +406,7 @@
  		}
  	} else {
  		if (ns->geom.totsz <= (128 << 20)) {
-			ns->geom.pgaddrbytes  = 5;
+			ns->geom.pgaddrbytes  = 4;
  			ns->geom.secaddrbytes = 2;
  		} else {
  			ns->geom.pgaddrbytes  = 5;




More information about the linux-mtd mailing list