Skip to contentSkip to conversation

ts72xx NAND driver

RFC PATCH In review Lennert Buytenhek 4 participants 9 messages Mar 2, 2006 – Mar 3, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 ts72xx NAND driver

Hello,

The attached patch, originally written by Jesse Off of Technologic Systems, implements support for the NAND flash on the Technologic Systems TS-7250 series of cirrus ep93xx boards.

Support for the ep93xx isn't upstream yet, but I'm trying to get it merged for 2.6.17, so it would be nice if this could go into 2.6.17 as well.

Any feedback appreciated..

cheers,
Lennert

drivers/mtd/nand/Kconfig +6 -0
diff -urN linux-2.6.15.orig/drivers/mtd/nand/Kconfig linux-2.6.15/drivers/mtd/nand/Kconfig
@@ -55,6 +55,12 @@
 	help
 	  Support for NAND flash on Texas Instruments Toto platform.
 
+config MTD_NAND_TS7250
+	tristate "NAND Flash device on TS-7250 board"
+	depends on MACH_TS72XX && MTD_NAND
+	help
+	  Support for NAND flash on Technologic Systems TS-7250 platform.
+
 config MTD_NAND_IDS
 	tristate
 
drivers/mtd/nand/Makefile +1 -0
diff -urN linux-2.6.15.orig/drivers/mtd/nand/Makefile linux-2.6.15/drivers/mtd/nand/Makefile
@@ -17,6 +17,7 @@
 obj-$(CONFIG_MTD_NAND_H1900)		+= h1910.o
 obj-$(CONFIG_MTD_NAND_RTC_FROM4)	+= rtc_from4.o
 obj-$(CONFIG_MTD_NAND_SHARPSL)		+= sharpsl.o
+obj-$(CONFIG_MTD_NAND_TS7250)		+= ts7250.o
 obj-$(CONFIG_MTD_NAND_NANDSIM)		+= nandsim.o
 
 nand-objs = nand_base.o nand_bbt.o
drivers/mtd/nand/ts7250.c +208 -0

208 lines not on this page · raw message

#1 lore raw
Quoted 2 lines · Lennert Buytenhek

Any feedback appreciated..

Just some minor (irrelevant?) stuff.

drivers/mtd/nand/ts7250.c line 81

Quoted 2 lines
drivers/mtd/nand/ts7250.c +2 -0
+extern int parse_cmdline_partitions(struct mtd_info *master,
+		struct mtd_partition **pparts, const char *mtd_id);

Adrian Bunk would send a patch against these lines within a few weeks. His reasoning is that .c files should include headers instead of adding function declarations on their own.

Review

Quoted 2 lines
(quoted diff) +2 -0
+	if (nand_scan (ts7250_mtd, 1)) {
+		kfree (ts7250_mtd);
                     ^

Non-compliant to kernel coding style.

drivers/mtd/nand/ts7250.c line 199

Quoted 1 line
drivers/mtd/nand/ts7250.c +1 -0
+	del_mtd_device (ts7250_mtd);

Jörn

Signature · 4 lines
To my face you have the audacity to advise me to become a thief - the worst
kind of thief that is conceivable, a thief of spiritual things, a thief of
ideas! It is insufferable, intolerable!
-- M. Binet in Scarabouche
#2 lore raw
Quoted 3 lines · Jörn Engel
Quoted 1 line

Any feedback appreciated..

Just some minor (irrelevant?) stuff.

Thanks!

Quoted 6 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+extern int parse_cmdline_partitions(struct mtd_info *master,
+		struct mtd_partition **pparts, const char *mtd_id);

Adrian Bunk would send a patch against these lines within a few weeks. His reasoning is that .c files should include headers instead of adding function declarations on their own.

ACK.

Quoted 4 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+	if (nand_scan (ts7250_mtd, 1)) {
+		kfree (ts7250_mtd);
                     ^

Non-compliant to kernel coding style.

ACK.

New version attached -- how does this look?

drivers/mtd/nand/Kconfig +6 -0
diff -urN linux-2.6.15.orig/drivers/mtd/nand/Kconfig linux-2.6.15/drivers/mtd/nand/Kconfig
@@ -55,6 +55,12 @@
 	help
 	  Support for NAND flash on Texas Instruments Toto platform.
 
+config MTD_NAND_TS7250
+	tristate "NAND Flash device on TS-7250 board"
+	depends on MACH_TS72XX && MTD_NAND
+	help
+	  Support for NAND flash on Technologic Systems TS-7250 platform.
+
 config MTD_NAND_IDS
 	tristate
 
drivers/mtd/nand/Makefile +1 -0
diff -urN linux-2.6.15.orig/drivers/mtd/nand/Makefile linux-2.6.15/drivers/mtd/nand/Makefile
@@ -17,6 +17,7 @@
 obj-$(CONFIG_MTD_NAND_H1900)		+= h1910.o
 obj-$(CONFIG_MTD_NAND_RTC_FROM4)	+= rtc_from4.o
 obj-$(CONFIG_MTD_NAND_SHARPSL)		+= sharpsl.o
+obj-$(CONFIG_MTD_NAND_TS7250)		+= ts7250.o
 obj-$(CONFIG_MTD_NAND_NANDSIM)		+= nandsim.o
 
 nand-objs = nand_base.o nand_bbt.o
drivers/mtd/nand/ts7250.c +208 -0

208 lines not on this page · raw message

#3 lore raw
Quoted 9 lines · Lennert Buytenhek
Quoted 5 lines

Review

Quoted 3 lines
(quoted diff) +2 -0
+	if (nand_scan (ts7250_mtd, 1)) {
+		kfree (ts7250_mtd);
                     ^

Non-compliant to kernel coding style.

ACK.

New version attached -- how does this look?

Unchanged wrt. the second irrelevant comment.

Jörn

Signature · 4 lines
The competent programmer is fully aware of the strictly limited size of
his own skull; therefore he approaches the programming task in full
humility, and among other things he avoids clever tricks like the plague. 
-- Edsger W. Dijkstra
#4 lore raw
Quoted 10 lines · Jörn Engel
Quoted 8 lines
Quoted 4 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+	if (nand_scan (ts7250_mtd, 1)) {
+		kfree (ts7250_mtd);
                     ^

Non-compliant to kernel coding style.

ACK.

New version attached -- how does this look?

Unchanged wrt. the second irrelevant comment.

Whoops, wrong patch :-(

drivers/mtd/nand/Kconfig +6 -0
diff -urN linux-2.6.15.orig/drivers/mtd/nand/Kconfig linux-2.6.15/drivers/mtd/nand/Kconfig
@@ -55,6 +55,12 @@
 	help
 	  Support for NAND flash on Texas Instruments Toto platform.
 
+config MTD_NAND_TS7250
+	tristate "NAND Flash device on TS-7250 board"
+	depends on MACH_TS72XX && MTD_NAND
+	help
+	  Support for NAND flash on Technologic Systems TS-7250 platform.
+
 config MTD_NAND_IDS
 	tristate
 
drivers/mtd/nand/Makefile +1 -0
diff -urN linux-2.6.15.orig/drivers/mtd/nand/Makefile linux-2.6.15/drivers/mtd/nand/Makefile
@@ -17,6 +17,7 @@
 obj-$(CONFIG_MTD_NAND_H1900)		+= h1910.o
 obj-$(CONFIG_MTD_NAND_RTC_FROM4)	+= rtc_from4.o
 obj-$(CONFIG_MTD_NAND_SHARPSL)		+= sharpsl.o
+obj-$(CONFIG_MTD_NAND_TS7250)		+= ts7250.o
 obj-$(CONFIG_MTD_NAND_NANDSIM)		+= nandsim.o
 
 nand-objs = nand_base.o nand_bbt.o
drivers/mtd/nand/ts7250.c +208 -0

208 lines not on this page · raw message

#5 lore raw

drivers/mtd/nand/ts7250.c line 189

Quoted 2 lines
drivers/mtd/nand/ts7250.c +2 -0
+	/* Return happy */
+	return 0;

This is very informative comment :-)

Signature · 3 lines
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia.
#6 lore raw
Quoted 4 lines · Artem B. Bityutskiy

drivers/mtd/nand/ts7250.c line 189

Quoted 3 lines
drivers/mtd/nand/ts7250.c +2 -0
+	/* Return happy */
+	return 0;

This is very informative comment :-)

And it should definitely be changed to "happily". ;)

Jörn

Signature · 3 lines
Man darf nicht das, was uns unwahrscheinlich und unnatürlich erscheint,
mit dem verwechseln, was absolut unmöglich ist.
-- Carl Friedrich Gauß
#7 lore raw
Quoted 7 lines · Jörn Engel
Quoted 4 lines · Artem B. Bityutskiy

drivers/mtd/nand/ts7250.c line 189

Quoted 3 lines
drivers/mtd/nand/ts7250.c +2 -0
+   /* Return happy */
+   return 0;

This is very informative comment :-)

And it should definitely be changed to "happily". ;)

It doesn't have to be. "happily" would be modifying the action, in this case returning. That is the equivalent of saying "I'll happily return to you". "Return happy" would be the equivalent of saying "I return to you in a good mood".

Doesn't english suck?

josh

#8 lore raw
Quoted 7 lines · Josh Boyer
Quoted 6 lines · Jörn Engel
Quoted 4 lines · Artem B. Bityutskiy

drivers/mtd/nand/ts7250.c line 189

Quoted 3 lines
drivers/mtd/nand/ts7250.c +2 -0
+   /* Return happy */
+   return 0;

This is very informative comment :-)

Quoted 8 lines
Quoted 1 line

And it should definitely be changed to "happily". ;)

It doesn't have to be. "happily" would be modifying the action, in this case returning. That is the equivalent of saying "I'll happily return to you". "Return happy" would be the equivalent of saying "I return to you in a good mood".

Doesn't english suck?

In this particular case: no. Such subtleties are the basis of any good poetry.

They also tend to be the basis of any well-obfuscated code, though.

Jörn

Signature · 2 lines
/* Keep these two variables together */
int bar;