mirror of
https://xff.cz/git/u-boot/
synced 2025-09-02 17:22:22 +02:00
mac: Fix the condition check for setting the MAC from the EEPROM
The issue got introduced in a cleanup by Manjunath Hadli in commit
826e99136e
. 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>
This commit is contained in:
committed by
Tom Rini
parent
4f47aceb11
commit
c8876f1c72
@@ -104,7 +104,7 @@ void davinci_sync_env_enetaddr(uint8_t *rom_enetaddr)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = eth_getenv_enetaddr_by_index("eth", 0, env_enetaddr);
|
ret = eth_getenv_enetaddr_by_index("eth", 0, env_enetaddr);
|
||||||
if (ret) {
|
if (!ret) {
|
||||||
/*
|
/*
|
||||||
* There is no MAC address in the environment, so we
|
* There is no MAC address in the environment, so we
|
||||||
* initialize it from the value in the EEPROM.
|
* 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);
|
ret = !eth_setenv_enetaddr("ethaddr", rom_enetaddr);
|
||||||
}
|
}
|
||||||
if (!ret)
|
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 */
|
#endif /* CONFIG_DRIVER_TI_EMAC */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user