[U-Boot] [PATCH] JFFS2: Eliminate compiler error when both NAND and OneNAND are enabled.

Scott Wood scottwood at freescale.com
Fri Oct 31 19:53:46 CET 2008


Reported-by: Alessandro Rubini <rubini-list at gnudd.com>
Signed-off-by: Scott Wood <scottwood at freescale.com>
---
Applied to u-boot-nand-flash

 fs/jffs2/jffs2_1pass.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c
index 0177268..920d2fd 100644
--- a/fs/jffs2/jffs2_1pass.c
+++ b/fs/jffs2/jffs2_1pass.c
@@ -449,20 +449,18 @@ static inline void *get_node_mem(u32 off)
 
 static inline void put_fl_mem(void *buf)
 {
-#if defined(CONFIG_JFFS2_NAND) && \
-    defined(CONFIG_CMD_NAND)
 	struct mtdids *id = current_part->dev->id;
 
-	if (id->type == MTD_DEV_TYPE_NAND)
+	switch (id->type) {
+#if defined(CONFIG_JFFS2_NAND) && defined(CONFIG_CMD_NAND)
+	case MTD_DEV_TYPE_NAND:
 		return put_fl_mem_nand(buf);
 #endif
-
 #if defined(CONFIG_CMD_ONENAND)
-	struct mtdids *id = current_part->dev->id;
-
-	if (id->type == MTD_DEV_TYPE_ONENAND)
+	case MTD_DEV_TYPE_ONENAND:
 		return put_fl_mem_onenand(buf);
 #endif
+	}
 }
 
 /* Compression names */
-- 
1.5.6.rc1.6.gc53ad


More information about the U-Boot mailing list