]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
JFFS2: Eliminate compiler error when both NAND and OneNAND are enabled.
authorScott Wood <scottwood@freescale.com>
Fri, 31 Oct 2008 18:51:12 +0000 (13:51 -0500)
committerScott Wood <scottwood@freescale.com>
Fri, 31 Oct 2008 18:51:12 +0000 (13:51 -0500)
Reported-by: Alessandro Rubini <rubini-list@gnudd.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
fs/jffs2/jffs2_1pass.c

index 0177268c3cee762862f2ca98f842aefc67550982..920d2fd453624e0e31e1671a92c853c35053c048 100644 (file)
@@ -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 */