From: Alessandro Rubini Date: Thu, 30 Oct 2008 08:49:15 +0100 Subject: [PATCH] Allow onenand and nand to cohexist in put_fl_mem Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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