public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] mtdparts: Call nand_init() during mtdparts_init().
@ 2010-10-15 18:59 Scott Wood
  2010-10-15 19:36 ` Wolfgang Denk
  0 siblings, 1 reply; 10+ messages in thread
From: Scott Wood @ 2010-10-15 18:59 UTC (permalink / raw)
  To: u-boot

The mtdparts code depends on the devices referred to by
partition specs actually existing, both for error checking,
when the spread feature is used, for bad block checking.

Signed-off-by: Scott Wood <scottwood@freescale.com>
---
 common/cmd_mtdparts.c |    5 +----
 include/nand.h        |    6 ++++++
 2 files changed, 7 insertions(+), 4 deletions(-)

Applied to u-boot-nand-flash

diff --git a/common/cmd_mtdparts.c b/common/cmd_mtdparts.c
index 5481c88..8e8ba47 100644
--- a/common/cmd_mtdparts.c
+++ b/common/cmd_mtdparts.c
@@ -96,15 +96,11 @@
 #include <linux/err.h>
 #include <linux/mtd/mtd.h>
 
-#if defined(CONFIG_CMD_NAND)
 #include <linux/mtd/nand.h>
 #include <nand.h>
-#endif
 
-#if defined(CONFIG_CMD_ONENAND)
 #include <linux/mtd/onenand.h>
 #include <onenand_uboot.h>
-#endif
 
 /* special size referring to all the remaining space in a partition */
 #define SIZE_REMAINING		0xFFFFFFFF
@@ -1711,6 +1707,7 @@ int mtdparts_init(void)
 		memset(last_ids, 0, MTDIDS_MAXLEN);
 		memset(last_parts, 0, MTDPARTS_MAXLEN);
 		memset(last_partition, 0, PARTITION_MAXLEN);
+		nand_init();
 		initialized = 1;
 	}
 
diff --git a/include/nand.h b/include/nand.h
index a452411..5ced821 100644
--- a/include/nand.h
+++ b/include/nand.h
@@ -24,7 +24,13 @@
 #ifndef _NAND_H_
 #define _NAND_H_
 
+#ifdef CONFIG_CMD_NAND
 extern void nand_init(void);
+#else
+static inline void nand_init(void)
+{
+}
+#endif
 
 #include <linux/mtd/compat.h>
 #include <linux/mtd/mtd.h>
-- 
1.7.0.4

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

end of thread, other threads:[~2010-10-15 23:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-15 18:59 [U-Boot] [PATCH] mtdparts: Call nand_init() during mtdparts_init() Scott Wood
2010-10-15 19:36 ` Wolfgang Denk
2010-10-15 19:47   ` Scott Wood
2010-10-15 20:08   ` Mike Frysinger
2010-10-15 21:39     ` Wolfgang Denk
2010-10-15 21:48       ` Scott Wood
2010-10-15 22:17         ` Wolfgang Denk
2010-10-15 22:35           ` Scott Wood
2010-10-15 22:48             ` Wolfgang Denk
2010-10-15 23:05               ` Scott Wood

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