]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
drivers/mtd/nand_legacy: Move conditional compilation to Makefile
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Tue, 12 Aug 2008 23:40:43 +0000 (01:40 +0200)
committerJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Tue, 12 Aug 2008 23:40:43 +0000 (01:40 +0200)
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
drivers/mtd/nand_legacy/Makefile
drivers/mtd/nand_legacy/nand_legacy.c

index 4e29c36e7046646ad03492201dd72f8a4a093d33..a1a9cc92b593c65eb3ef79d76b7636f3d26ebec1 100644 (file)
@@ -25,8 +25,11 @@ include $(TOPDIR)/config.mk
 
 LIB    := $(obj)libnand_legacy.a
 
-COBJS  := nand_legacy.o
+ifdef CONFIG_CMD_NAND
+COBJS-$(CONFIG_NAND_LEGACY)    := nand_legacy.o
+endif
 
+COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
 
index 8f7dc3901af56af08817728917ac12c61db65aa6..bf5565a8fbe758d05493338c1cfb6090c8ff198d 100644 (file)
@@ -14,9 +14,6 @@
 #include <malloc.h>
 #include <asm/io.h>
 #include <watchdog.h>
-
-#if defined(CONFIG_CMD_NAND) && defined(CONFIG_NAND_LEGACY)
-
 #include <linux/mtd/nand_legacy.h>
 #include <linux/mtd/nand_ids.h>
 #include <jffs2/jffs2.h>
@@ -1608,5 +1605,3 @@ int read_jffs2_nand(size_t start, size_t len,
                        start, len, retlen, buf);
 }
 #endif /* CONFIG_JFFS2_NAND */
-
-#endif