public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] net/eth.c: fix eth_write_hwaddr() to use dev->enetaddr as fall back
@ 2012-01-16 21:55 Zach Sadecki
  2012-01-17  9:52 ` Wolfgang Denk
  0 siblings, 1 reply; 14+ messages in thread
From: Zach Sadecki @ 2012-01-16 21:55 UTC (permalink / raw)
  To: u-boot

This patch will also fix a problem with mx28 boards that are depending 
on the OCOTP bits to set the MAC address (like the Denx m28 board).  Now 
it simply fails with a "Warning: failed to set MAC address" if there's 
no environment variable instead of using the OCOTP bits like it should.  
This patch will fix that.

^ permalink raw reply	[flat|nested] 14+ messages in thread
* [U-Boot] [PATCH] net/eth.c: fix eth_write_hwaddr() to use dev->enetaddr as fall back
@ 2011-08-17  5:33 Eric Miao
  2011-08-17  6:22 ` Simon Glass
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Eric Miao @ 2011-08-17  5:33 UTC (permalink / raw)
  To: u-boot

Ignore the return value of eth_getenv_enetaddr_by_index(), and if it
fails, fall back to use dev->enetaddr, which could be filled up by
the ethernet device driver.

Actually, this is the original behavior, and was later changed by
commit 48506a2cde2458fa1f8c5993afc98e5a4617e1d3.

Signed-off-by: Eric Miao <eric.miao@linaro.org>
---
 net/eth.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/net/eth.c b/net/eth.c
index a34fe59..c4fbe11 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -195,8 +195,7 @@ int eth_write_hwaddr(struct eth_device *dev, const char *base_name,
 	unsigned char env_enetaddr[6];
 	int ret = 0;
 
-	if (!eth_getenv_enetaddr_by_index(base_name, eth_number, env_enetaddr))
-		return -1;
+	eth_getenv_enetaddr_by_index(base_name, eth_number, env_enetaddr);
 
 	if (memcmp(env_enetaddr, "\0\0\0\0\0\0", 6)) {
 		if (memcmp(dev->enetaddr, "\0\0\0\0\0\0", 6) &&
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2012-01-17 16:17 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-16 21:55 [U-Boot] [PATCH] net/eth.c: fix eth_write_hwaddr() to use dev->enetaddr as fall back Zach Sadecki
2012-01-17  9:52 ` Wolfgang Denk
2012-01-17 16:17   ` Dirk Behme
  -- strict thread matches above, loose matches on Subject: below --
2011-08-17  5:33 Eric Miao
2011-08-17  6:22 ` Simon Glass
2012-01-11 12:23   ` Dirk Behme
2012-01-12  5:12     ` Simon Glass
2012-01-12  7:48       ` Stefan Roese
2012-01-12  7:55 ` Stefan Roese
2012-01-13 19:19 ` Wolfgang Denk
2012-01-16  7:03   ` Eric Miao
2012-01-16  7:08     ` Eric Miao
2012-01-16 14:08   ` Philip Balister
2012-01-16 16:00     ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox