summaryrefslogtreecommitdiff
path: root/arch/arm/cpu/arm926ejs
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@freyther.de>2013-02-07 23:41:03 +0000
committerTom Rini <trini@ti.com>2013-02-20 08:52:41 -0500
commitc8876f1c72ac36879436278892e6c20a93174b6a (patch)
tree6bfa7779cfb93bb9cef22c54358d43edb635bbfc /arch/arm/cpu/arm926ejs
parent4f47aceb118b291831a603d7e6ca651d76bf88e0 (diff)
downloadu-boot-imx-c8876f1c72ac36879436278892e6c20a93174b6a.zip
u-boot-imx-c8876f1c72ac36879436278892e6c20a93174b6a.tar.gz
u-boot-imx-c8876f1c72ac36879436278892e6c20a93174b6a.tar.bz2
mac: Fix the condition check for setting the MAC from the EEPROM
The issue got introduced in a cleanup by Manjunath Hadli in commit 826e99136e2bce61f3f6572e32d7aa724c116e6d. The eth_getenv_enetaddr_by_index method will validate the MAC addr and if none is set in the environment 0 will be returned. Set the MAC from the eeprom if no valid address is found in environment. Signed-off-by: Holger Hans Peter Freyther <holger@freyther.de>
Diffstat (limited to 'arch/arm/cpu/arm926ejs')
-rw-r--r--arch/arm/cpu/arm926ejs/davinci/misc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm/cpu/arm926ejs/davinci/misc.c b/arch/arm/cpu/arm926ejs/davinci/misc.c
index c310c69..162c1e0 100644
--- a/arch/arm/cpu/arm926ejs/davinci/misc.c
+++ b/arch/arm/cpu/arm926ejs/davinci/misc.c
@@ -104,7 +104,7 @@ void davinci_sync_env_enetaddr(uint8_t *rom_enetaddr)
int ret;
ret = eth_getenv_enetaddr_by_index("eth", 0, env_enetaddr);
- if (ret) {
+ if (!ret) {
/*
* There is no MAC address in the environment, so we
* initialize it from the value in the EEPROM.
@@ -115,7 +115,7 @@ void davinci_sync_env_enetaddr(uint8_t *rom_enetaddr)
ret = !eth_setenv_enetaddr("ethaddr", rom_enetaddr);
}
if (!ret)
- printf("Failed to set mac address from EEPROM\n");
+ printf("Failed to set mac address from EEPROM: %d\n", ret);
}
#endif /* CONFIG_DRIVER_TI_EMAC */