env_nvram: Move conditional compilation to Makefile
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Wed, 10 Sep 2008 20:47:59 +0000 (22:47 +0200)
committerJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Wed, 10 Sep 2008 20:47:59 +0000 (22:47 +0200)
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
common/Makefile
common/env_nvram.c

index 2e0fa262dc8c4893c5fe9049c8c51ee3501a6365..cb3a7425f7476ef1f4fa6fe605ecc8587ca97601 100644 (file)
@@ -54,7 +54,7 @@ COBJS-$(CONFIG_ENV_IS_IN_DATAFLASH) += env_dataflash.o
 COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_eeprom.o
 COBJS-y += env_flash.o
 COBJS-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o
-COBJS-y += env_nvram.o
+COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_nvram.o
 COBJS-y += env_onenand.o
 COBJS-y += env_sf.o
 COBJS-y += env_nowhere.o
index c877f00a6675caf9f62d266355676309d80de4b1..c59bf9faa1bdde58112737c117305d4c101de544 100644 (file)
  */
 
 #include <common.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-#ifdef CONFIG_ENV_IS_IN_NVRAM /* Environment is in NVRAM */
-
 #include <command.h>
 #include <environment.h>
 #include <linux/stddef.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifdef CFG_NVRAM_ACCESS_ROUTINE
 extern void *nvram_read(void *dest, const long src, size_t count);
 extern void nvram_write(long dest, const void *src, size_t count);
@@ -156,5 +153,3 @@ int env_init (void)
 #endif
        return (0);
 }
-
-#endif /* CONFIG_ENV_IS_IN_NVRAM */