Skip to contentSkip to conversation

Allow onenand and nand to cohexist in put_fl_mem

PATCH New Alessandro Rubini 1 participant 1 message Oct 30, 2008 Journalling flash file system V2 (JFFS2)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Allow onenand and nand to cohexist in put_fl_mem

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(-)
fs/jffs2/jffs2_1pass.c +1 -2
index 0177268..986d6d2 100644
@@ -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);
Signature · 1 line
1.6.0.2