From patchwork Tue Nov 10 19:53:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 542585 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 65B50141430 for ; Wed, 11 Nov 2015 06:56:49 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6FEFD4B8D5; Tue, 10 Nov 2015 20:55:23 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 636ajS4tHu9X; Tue, 10 Nov 2015 20:55:23 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 54C724B8D6; Tue, 10 Nov 2015 20:54:34 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6A8784B83D for ; Tue, 10 Nov 2015 20:54:05 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ylteKlROY8if for ; Tue, 10 Nov 2015 20:54:05 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by theia.denx.de (Postfix) with ESMTPS id 9C8E44B85B for ; Tue, 10 Nov 2015 20:54:00 +0100 (CET) Received: from mail.nefkom.net (unknown [192.168.8.184]) by mail-out.m-online.net (Postfix) with ESMTP id 3nwKdF3rs6z3hj6W; Tue, 10 Nov 2015 20:53:53 +0100 (CET) X-Auth-Info: Scnjl5TCVqlT0NJLFn79oiu3G621f7vPfNi/Z1R3ZU8= Received: from chi.lan (unknown [195.140.253.167]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA id 3nwKdF1lfSzvdWS; Tue, 10 Nov 2015 20:53:53 +0100 (CET) From: Marek Vasut To: u-boot@lists.denx.de Date: Tue, 10 Nov 2015 20:53:27 +0100 Message-Id: <1447185213-5799-11-git-send-email-marex@denx.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1447185213-5799-1-git-send-email-marex@denx.de> References: <1447185213-5799-1-git-send-email-marex@denx.de> Cc: Marek Vasut , Tom Rini Subject: [U-Boot] [PATCH 11/17] eeprom: Suck the ifdef into eeprom_init() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 Reviewed-by: Heiko Schocher --- common/cmd_eeprom.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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);