mirror of
https://github.com/Stichting-MINIX-Research-Foundation/u-boot.git
synced 2025-09-12 05:25:11 -04:00
davinci: cleanup davinci_sync_env_enetaddr() fucntion
check for the return status for eth_getenv_enetaddr_by_index() and eth_setenv_enetaddr() functions and print appropriate message on failure. Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com> Cc: Tom Rini <trini@ti.com> Cc: Mike Frysinger <vapier@gentoo.org> Cc: Wolfgang Denk <wd@denx.de> Acked-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
parent
fa34f6b25b
commit
826e99136e
@ -101,9 +101,10 @@ void davinci_emac_mii_mode_sel(int mode_sel)
|
|||||||
void davinci_sync_env_enetaddr(uint8_t *rom_enetaddr)
|
void davinci_sync_env_enetaddr(uint8_t *rom_enetaddr)
|
||||||
{
|
{
|
||||||
uint8_t env_enetaddr[6];
|
uint8_t env_enetaddr[6];
|
||||||
|
int ret;
|
||||||
|
|
||||||
eth_getenv_enetaddr_by_index("eth", 0, env_enetaddr);
|
ret = eth_getenv_enetaddr_by_index("eth", 0, env_enetaddr);
|
||||||
if (!memcmp(env_enetaddr, "\0\0\0\0\0\0", 6)) {
|
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.
|
||||||
@ -111,8 +112,10 @@ void davinci_sync_env_enetaddr(uint8_t *rom_enetaddr)
|
|||||||
debug("### Setting environment from EEPROM MAC address = "
|
debug("### Setting environment from EEPROM MAC address = "
|
||||||
"\"%pM\"\n",
|
"\"%pM\"\n",
|
||||||
env_enetaddr);
|
env_enetaddr);
|
||||||
eth_setenv_enetaddr("ethaddr", rom_enetaddr);
|
ret = !eth_setenv_enetaddr("ethaddr", rom_enetaddr);
|
||||||
}
|
}
|
||||||
|
if (!ret)
|
||||||
|
printf("Failed to set mac address from EEPROM\n");
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_DRIVER_TI_EMAC */
|
#endif /* CONFIG_DRIVER_TI_EMAC */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user