From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Mon, 16 Nov 2015 12:28:51 +0100 Subject: [U-Boot] [PATCH 11/17] eeprom: Suck the ifdef into eeprom_init() In-Reply-To: <1447185213-5799-11-git-send-email-marex@denx.de> References: <1447185213-5799-1-git-send-email-marex@denx.de> <1447185213-5799-11-git-send-email-marex@denx.de> Message-ID: <5649BDF3.5050102@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Marek, Am 10.11.2015 um 20:53 schrieb Marek Vasut: > 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 > Cc: Simon Glass > Cc: Tom Rini > Cc: Heiko Schocher > --- > common/cmd_eeprom.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) Reviewed-by: Heiko Schocher bye, Heiko > > diff --git a/common/cmd_eeprom.c b/common/cmd_eeprom.c > index 8451d63..c38c534 100644 > --- a/common/cmd_eeprom.c > +++ b/common/cmd_eeprom.c > @@ -57,7 +57,7 @@ void eeprom_init(void) > { > /* SPI EEPROM */ > #if defined(CONFIG_SPI) && !defined(CONFIG_ENV_EEPROM_IS_ON_I2C) > - spi_init_f (); > + spi_init_f(); > #endif > > /* 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); > cnt = simple_strtoul(*args++, NULL, 16); > > -# if !defined(CONFIG_SPI) || defined(CONFIG_ENV_EEPROM_IS_ON_I2C) > - eeprom_init (); > -# endif /* !CONFIG_SPI */ > + eeprom_init(); > > if (strcmp (argv[1], "read") == 0) { > printf(fmt, dev_addr, argv[1], addr, off, cnt); > -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany