* [U-Boot] [PATCH v2] davinci: cleanup davinci_sync_env_enetaddr() fucntion
@ 2012-02-08 11:14 Manjunath Hadli
2012-02-09 4:18 ` Mike Frysinger
0 siblings, 1 reply; 4+ messages in thread
From: Manjunath Hadli @ 2012-02-08 11:14 UTC (permalink / raw)
To: u-boot
check for the return status for eth_getenv_enetaddr_by_index()
and eth_setenv_enetaddr() functions and print appropriate message
on failure. Also convert debug message to printf().
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>
---
Changes for v2:
Removed additional check of comparing ethernet address is all
zeros, As the core code already calls is_valid_ether_addr()
and one of the checks in there is for all zeros.
arch/arm/cpu/arm926ejs/davinci/misc.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/arch/arm/cpu/arm926ejs/davinci/misc.c b/arch/arm/cpu/arm926ejs/davinci/misc.c
index 5f510b6..48a635c 100644
--- a/arch/arm/cpu/arm926ejs/davinci/misc.c
+++ b/arch/arm/cpu/arm926ejs/davinci/misc.c
@@ -101,18 +101,21 @@ 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;
- eth_getenv_enetaddr_by_index("eth", 0, env_enetaddr);
- if (!memcmp(env_enetaddr, "\0\0\0\0\0\0", 6)) {
+ ret = eth_getenv_enetaddr_by_index("eth", 0, env_enetaddr);
+ if (ret) {
/*
* There is no MAC address in the environment, so we
* initialize it from the value in the EEPROM.
*/
- debug("### Setting environment from EEPROM MAC address = "
+ printf("### Setting environment from EEPROM MAC address = "
"\"%pM\"\n",
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 */
--
1.6.2.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH v2] davinci: cleanup davinci_sync_env_enetaddr() fucntion
2012-02-08 11:14 [U-Boot] [PATCH v2] davinci: cleanup davinci_sync_env_enetaddr() fucntion Manjunath Hadli
@ 2012-02-09 4:18 ` Mike Frysinger
2012-02-09 12:16 ` Hadli, Manjunath
0 siblings, 1 reply; 4+ messages in thread
From: Mike Frysinger @ 2012-02-09 4:18 UTC (permalink / raw)
To: u-boot
On Wednesday 08 February 2012 06:14:35 Manjunath Hadli wrote:
> - debug("### Setting environment from EEPROM MAC address = "
> + printf("### Setting environment from EEPROM MAC address = "
i don't think this should be displayed as this is the normal behavior ...
otherwise, looks OK to me ...
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120208/bbf12245/attachment.pgp>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH v2] davinci: cleanup davinci_sync_env_enetaddr() fucntion
2012-02-09 4:18 ` Mike Frysinger
@ 2012-02-09 12:16 ` Hadli, Manjunath
2012-02-09 15:58 ` Mike Frysinger
0 siblings, 1 reply; 4+ messages in thread
From: Hadli, Manjunath @ 2012-02-09 12:16 UTC (permalink / raw)
To: u-boot
Mike,
On Thu, Feb 09, 2012 at 09:48:55, Mike Frysinger wrote:
> On Wednesday 08 February 2012 06:14:35 Manjunath Hadli wrote:
> > - debug("### Setting environment from EEPROM MAC address = "
> > + printf("### Setting environment from EEPROM MAC address = "
>
> i don't think this should be displayed as this is the normal behavior ...
or how about rather keeping it debug itself? If you insist I will remove it.
Regards,
--Manju
> otherwise, looks OK to me ...
> -mike
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH v2] davinci: cleanup davinci_sync_env_enetaddr() fucntion
2012-02-09 12:16 ` Hadli, Manjunath
@ 2012-02-09 15:58 ` Mike Frysinger
0 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2012-02-09 15:58 UTC (permalink / raw)
To: u-boot
On Thursday 09 February 2012 07:16:21 Hadli, Manjunath wrote:
> On Thu, Feb 09, 2012 at 09:48:55, Mike Frysinger wrote:
> > On Wednesday 08 February 2012 06:14:35 Manjunath Hadli wrote:
> > > - debug("### Setting environment from EEPROM MAC address = "
> > > + printf("### Setting environment from EEPROM MAC address = "
> >
> > i don't think this should be displayed as this is the normal behavior ...
>
> or how about rather keeping it debug itself? If you insist I will remove
> it.
debug() is fine. i just didn't like the conversion to printf().
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120209/34522970/attachment.pgp>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-02-09 15:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-08 11:14 [U-Boot] [PATCH v2] davinci: cleanup davinci_sync_env_enetaddr() fucntion Manjunath Hadli
2012-02-09 4:18 ` Mike Frysinger
2012-02-09 12:16 ` Hadli, Manjunath
2012-02-09 15:58 ` Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox