From patchwork Tue Jan 29 07:28:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Kim_B=C3=B8ndergaard?= X-Patchwork-Id: 216450 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 321EA2C0094 for ; Tue, 29 Jan 2013 18:39:01 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A30124A178; Tue, 29 Jan 2013 08:38:58 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 ybT9+Fkf-Yig; Tue, 29 Jan 2013 08:38:58 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1C2584A18B; Tue, 29 Jan 2013 08:38:45 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 93B074A143 for ; Tue, 29 Jan 2013 08:38:42 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 aDIsXYOlweSW for ; Tue, 29 Jan 2013 08:38:42 +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 mail02.prevas.se (mail02.prevas.se [62.95.78.10]) by theia.denx.de (Postfix) with ESMTPS id 591994A158 for ; Tue, 29 Jan 2013 08:38:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=prevas.dk; i=@prevas.dk; l=1226; q=dns/txt; s=ironport2; t=1359445116; x=1390981116; h=from:to:subject:date:message-id:in-reply-to:references: mime-version; bh=LHo4TC1C8WqlkLKGv8QzCPuSogxYUzxalzu6t3sbvpA=; b=iNd4sCSw71sbidxj0ei0H+CnHPI71hGGs7+2VKeMXDrs0RG96Bu477Zi PWANINLMyHDF0dKYi7OkCZnpBV/iLQ8CDMqsIVAPNs4t0T4UCFBMXtnef CqBw7nE+wlpeKj7FCN7+KIPFg/LlfudnniXZBNQ/ttAj1JbLfmqNiltE0 8=; X-IronPort-AV: E=Sophos;i="4.84,557,1355094000"; d="scan'208";a="2078843" Received: from vmprevas3.prevas.se (HELO smtp.prevas.se) ([172.16.8.103]) by ironport2.prevas.se with ESMTP/TLS/AES128-SHA; 29 Jan 2013 08:28:23 +0100 Received: from localhost (172.16.10.102) by smtp.prevas.se (172.16.8.105) with Microsoft SMTP Server id 14.2.328.9; Tue, 29 Jan 2013 08:28:22 +0100 Received: by localhost (Postfix, from userid 30019) id 8D432344AF; Tue, 29 Jan 2013 07:28:22 +0000 (UTC) From: =?UTF-8?q?Kim=20B=C3=B8ndergaard?= To: , , , Date: Tue, 29 Jan 2013 07:28:20 +0000 Message-ID: <254d277c90abc767b249e82e25bc41ff2771ecd2.1359443560.git.kibo@prevas.dk> X-Mailer: git-send-email 1.8.0.3 In-Reply-To: References: MIME-Version: 1.0 Subject: [U-Boot] [PATCH 2/2] Davinci: Fix, console output confusing while setting MAC address X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de --- arch/arm/cpu/arm926ejs/davinci/misc.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/arch/arm/cpu/arm926ejs/davinci/misc.c b/arch/arm/cpu/arm926ejs/davinci/misc.c index d0389a4..dc74af6 100644 --- a/arch/arm/cpu/arm926ejs/davinci/misc.c +++ b/arch/arm/cpu/arm926ejs/davinci/misc.c @@ -104,10 +104,8 @@ void davinci_emac_mii_mode_sel(int mode_sel) void davinci_sync_env_enetaddr(uint8_t *rom_enetaddr) { uint8_t env_enetaddr[6]; - int ret; - ret = eth_getenv_enetaddr_by_index("eth", 0, env_enetaddr); - if (ret) { + if (!eth_getenv_enetaddr_by_index("eth", 0, env_enetaddr)) { /* * There is no MAC address in the environment, so we * initialize it from the value in the EEPROM. @@ -115,10 +113,9 @@ void davinci_sync_env_enetaddr(uint8_t *rom_enetaddr) debug("### Setting environment from EEPROM MAC address = " "\"%pM\"\n", env_enetaddr); - ret = !eth_setenv_enetaddr("ethaddr", rom_enetaddr); + if (!eth_setenv_enetaddr("ethaddr", rom_enetaddr)) + printf("Failed to set mac address from EEPROM\n"); } - if (!ret) - printf("Failed to set mac address from EEPROM\n"); } #endif /* CONFIG_DRIVER_TI_EMAC */