[PATCH] Allow onenand and nand to cohexist in put_fl_mem

Alessandro Rubini rubini at unipv.it
Thu Oct 30 08:49:15 CET 2008


If a board has both CONFIG_CMD_NAND and CONFIG_CMD_ONENAND,
put_fl_mem would define "id" twice. This, however, introduces
a warning if neither NAND type is selected.
---
 fs/jffs2/jffs2_1pass.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c
index 0177268..986d6d2 100644
--- a/fs/jffs2/jffs2_1pass.c
+++ b/fs/jffs2/jffs2_1pass.c
@@ -449,16 +449,15 @@ static inline void *get_node_mem(u32 off)
 
 static inline void put_fl_mem(void *buf)
 {
+	struct mtdids *id = current_part->dev->id;
 #if defined(CONFIG_JFFS2_NAND) && \
     defined(CONFIG_CMD_NAND)
-	struct mtdids *id = current_part->dev->id;
 
 	if (id->type == 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)
 		return put_fl_mem_onenand(buf);
-- 
1.6.0.2


More information about the U-Boot mailing list