From patchwork Tue Nov 10 19:53:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 542582 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 C92D7141430 for ; Wed, 11 Nov 2015 06:56:01 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 04BCC4B893; Tue, 10 Nov 2015 20:55:08 +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 0HFKNDuIF84s; Tue, 10 Nov 2015 20:55:07 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 368CA4B85B; Tue, 10 Nov 2015 20:54:24 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5D1F84B83F for ; Tue, 10 Nov 2015 20:53:58 +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 GosXD-vKq2Gw for ; Tue, 10 Nov 2015 20:53:58 +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.10]) by theia.denx.de (Postfix) with ESMTPS id 1A4884B83C for ; Tue, 10 Nov 2015 20:53:54 +0100 (CET) Received: from mail.nefkom.net (unknown [192.168.8.184]) by mail-out.m-online.net (Postfix) with ESMTP id 3nwKdD5X9Wz3hmZ3; Tue, 10 Nov 2015 20:53:52 +0100 (CET) X-Auth-Info: aY1dSuzx4shzon2no2b5PvJvfbYKqU3sDDQ2DsEs1hM= Received: from chi.lan (unknown [195.140.253.167]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA id 3nwKdD3Cc4zvdWS; Tue, 10 Nov 2015 20:53:52 +0100 (CET) From: Marek Vasut To: u-boot@lists.denx.de Date: Tue, 10 Nov 2015 20:53:25 +0100 Message-Id: <1447185213-5799-9-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 09/17] eeprom: Make eeprom_write_enable() weak 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" Make this function weak and implement it's weak implementation so that the boards can just reimplement it. This zaps the horrid CONFIG_SYS_EEPROM_WREN macro. Signed-off-by: Marek Vasut Cc: Simon Glass Cc: Tom Rini Cc: Heiko Schocher Reviewed-by: Heiko Schocher --- common/cmd_eeprom.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/common/cmd_eeprom.c b/common/cmd_eeprom.c index 5979993..040ab5f 100644 --- a/common/cmd_eeprom.c +++ b/common/cmd_eeprom.c @@ -44,9 +44,10 @@ #endif #endif -#if defined(CONFIG_SYS_EEPROM_WREN) -extern int eeprom_write_enable (unsigned dev_addr, int state); -#endif +__weak int eeprom_write_enable(unsigned dev_addr, int state) +{ + return 0; +} void eeprom_init(void) { @@ -163,9 +164,8 @@ int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cn int rcode = 0; uchar addr[3]; -#if defined(CONFIG_SYS_EEPROM_WREN) - eeprom_write_enable (dev_addr,1); -#endif + eeprom_write_enable(dev_addr, 1); + /* * Write data until done or would cross a write page boundary. * We must write the address again when changing pages @@ -215,9 +215,9 @@ int eeprom_write (unsigned dev_addr, unsigned offset, uchar *buffer, unsigned cn udelay(CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS * 1000); #endif } -#if defined(CONFIG_SYS_EEPROM_WREN) - eeprom_write_enable (dev_addr,0); -#endif + + eeprom_write_enable(dev_addr, 0); + return rcode; }