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

Kim Bøndergaard kibo at prevas.dk
Tue Jan 22 14:20:00 CET 2013


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



More information about the U-Boot mailing list