Patchwork [U-Boot,2/2] Davinci: Fix, console output confusing while setting MAC address

login
register
mail settings
Submitter Kim B√łndergaard
Date Jan. 22, 2013, 1:20 p.m.
Message ID <254d277c90abc767b249e82e25bc41ff2771ecd2.1358860629.git.kibo@prevas.dk>
Download mbox | patch
Permalink /patch/214552/
State Superseded
Delegated to: Tom Rini
Headers show

Comments

Kim B√łndergaard - Jan. 22, 2013, 1:20 p.m.
---
 arch/arm/cpu/arm926ejs/davinci/misc.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

Patch

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 */