mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-04-11 17:01:34 +00:00
eeprom: Suck the ifdef into eeprom_init()
Just suck the ugly ifdef around eeprom_init() call into eeprom_init() function itself. This puts all of the ifdef mess into one place. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com> Cc: Heiko Schocher <hs@denx.de> Reviewed-by: Heiko Schocher <hs@denx.de>
This commit is contained in:
parent
d738746cc3
commit
8eee40a602
1 changed files with 2 additions and 4 deletions
|
@ -57,7 +57,7 @@ void eeprom_init(void)
|
||||||
{
|
{
|
||||||
/* SPI EEPROM */
|
/* SPI EEPROM */
|
||||||
#if defined(CONFIG_SPI) && !defined(CONFIG_ENV_EEPROM_IS_ON_I2C)
|
#if defined(CONFIG_SPI) && !defined(CONFIG_ENV_EEPROM_IS_ON_I2C)
|
||||||
spi_init_f ();
|
spi_init_f();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* I2C EEPROM */
|
/* I2C EEPROM */
|
||||||
|
@ -248,9 +248,7 @@ static int do_eeprom(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||||
off = simple_strtoul(*args++, NULL, 16);
|
off = simple_strtoul(*args++, NULL, 16);
|
||||||
cnt = simple_strtoul(*args++, NULL, 16);
|
cnt = simple_strtoul(*args++, NULL, 16);
|
||||||
|
|
||||||
# if !defined(CONFIG_SPI) || defined(CONFIG_ENV_EEPROM_IS_ON_I2C)
|
eeprom_init();
|
||||||
eeprom_init ();
|
|
||||||
# endif /* !CONFIG_SPI */
|
|
||||||
|
|
||||||
if (strcmp (argv[1], "read") == 0) {
|
if (strcmp (argv[1], "read") == 0) {
|
||||||
printf(fmt, dev_addr, argv[1], addr, off, cnt);
|
printf(fmt, dev_addr, argv[1], addr, off, cnt);
|
||||||
|
|
Loading…
Add table
Reference in a new issue