[U-Boot] [PATCH 07/25] cmd_eeprom: Move conditional compilation to Makefile

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Sun Aug 31 03:38:56 CEST 2008


Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
 common/Makefile     |    2 +-
 common/cmd_eeprom.c |    6 ------
 2 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/common/Makefile b/common/Makefile
index 3f601e8..a7d5b59 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -79,7 +79,7 @@ endif
 COBJS-$(CONFIG_CMD_DISPLAY) += cmd_display.o
 COBJS-$(CONFIG_CMD_DOC) += cmd_doc.o
 COBJS-$(CONFIG_CMD_DTT) += cmd_dtt.o
-COBJS-y += cmd_eeprom.o
+COBJS-$(CONFIG_ENV_IS_IN_EEPROM)$(CONFIG_CMD_EEPROM) += cmd_eeprom.o
 COBJS-$(CONFIG_CMD_ELF) += cmd_elf.o
 COBJS-$(CONFIG_CMD_EXT2) += cmd_ext2.o
 COBJS-$(CONFIG_CMD_FAT) += cmd_fat.o
diff --git a/common/cmd_eeprom.c b/common/cmd_eeprom.c
index 5034b5e..44d44fe 100644
--- a/common/cmd_eeprom.c
+++ b/common/cmd_eeprom.c
@@ -42,8 +42,6 @@
 #include <command.h>
 #include <i2c.h>
 
-#if defined(CONFIG_ENV_IS_IN_EEPROM) || defined(CONFIG_CMD_EEPROM)
-
 extern void eeprom_init  (void);
 extern int  eeprom_read  (unsigned dev_addr, unsigned offset,
 			  uchar *buffer, unsigned cnt);
@@ -52,7 +50,6 @@ extern int  eeprom_write (unsigned dev_addr, unsigned offset,
 #if defined(CFG_EEPROM_WREN)
 extern int eeprom_write_enable (unsigned dev_addr, int state);
 #endif
-#endif
 
 
 #if defined(CFG_EEPROM_X40430)
@@ -121,8 +118,6 @@ int do_eeprom ( cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
  *   0x00000nxx for EEPROM address selectors and page number at n.
  */
 
-#if defined(CONFIG_ENV_IS_IN_EEPROM) || defined(CONFIG_CMD_EEPROM)
-
 #ifndef CONFIG_SPI
 #if !defined(CFG_I2C_EEPROM_ADDR_LEN) || CFG_I2C_EEPROM_ADDR_LEN < 1 || CFG_I2C_EEPROM_ADDR_LEN > 2
 #error CFG_I2C_EEPROM_ADDR_LEN must be 1 or 2
@@ -422,7 +417,6 @@ void eeprom_init  (void)
 }
 /*-----------------------------------------------------------------------
  */
-#endif
 
 /***************************************************/
 
-- 
1.5.6.3



More information about the U-Boot mailing list