public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH][01/03] nandsim bugfix
@ 2005-05-23  7:33 Kluba Patrik
  2005-05-23  8:51 ` Artem B. Bityuckiy
  0 siblings, 1 reply; 2+ messages in thread
From: Kluba Patrik @ 2005-05-23  7:33 UTC (permalink / raw)
  To: linux-mtd


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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-05-23  8:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-23  7:33 [PATCH][01/03] nandsim bugfix Kluba Patrik
2005-05-23  8:51 ` Artem B. Bityuckiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox