From: Scott Wood Date: Fri, 31 Oct 2008 18:51:12 +0000 (-0500) Subject: JFFS2: Eliminate compiler error when both NAND and OneNAND are enabled. X-Git-Tag: v2009.01-rc1~97^2~1 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2f77c7f45b9a37ef265a8dbe3c18efa706fed214;p=oweals%2Fu-boot.git JFFS2: Eliminate compiler error when both NAND and OneNAND are enabled. Reported-by: Alessandro Rubini Signed-off-by: Scott Wood --- diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c index 0177268c3c..920d2fd453 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 */