From patchwork Mon Oct 20 01:48:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 400929 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 58E0614007B for ; Mon, 20 Oct 2014 12:56:27 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D8B56A745E; Mon, 20 Oct 2014 03:51:21 +0200 (CEST) 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 tBr+8Tq9okuZ; Mon, 20 Oct 2014 03:51:21 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 45170A7436; Mon, 20 Oct 2014 03:51:21 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8753D4B61D for ; Mon, 20 Oct 2014 03:48:54 +0200 (CEST) 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 9TL1Coiihmha for ; Mon, 20 Oct 2014 03:48:54 +0200 (CEST) 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 6CA2D4B61F for ; Mon, 20 Oct 2014 03:48:52 +0200 (CEST) Received: from mail.nefkom.net (unknown [192.168.8.184]) by mail-out.m-online.net (Postfix) with ESMTP id 3jLgqR2wv9z3hjXW; Mon, 20 Oct 2014 03:48:51 +0200 (CEST) X-Auth-Info: v79L09QvjiUxRw36ZjB1zvyva95wLkQTR/FDHANV/p8= Received: from chi.lan (unknown [195.140.253.167]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA id 3jLgqQ6qHBzvdWR; Mon, 20 Oct 2014 03:48:50 +0200 (CEST) From: Marek Vasut To: u-boot@lists.denx.de Date: Mon, 20 Oct 2014 03:48:17 +0200 Message-Id: <1413769706-8596-17-git-send-email-marex@denx.de> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1413769706-8596-1-git-send-email-marex@denx.de> References: <1413769706-8596-1-git-send-email-marex@denx.de> Cc: Marek Vasut , Tom Rini Subject: [U-Boot] [PATCH 16/25] eeprom: Make eeprom_write_enable() weak X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 --- 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 78c6121..3fc3706 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; }