public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] Ethernet: let user know if there is no valid ethernet address
@ 2014-07-11  9:42 Pavel Machek
  2014-07-11  9:46 ` Marek Vasut
  2014-07-11 15:27 ` Wolfgang Denk
  0 siblings, 2 replies; 14+ messages in thread
From: Pavel Machek @ 2014-07-11  9:42 UTC (permalink / raw)
  To: u-boot

When there's no ethernet address available, u-boot currently prints
"could not set ethernet address", but fails to mention that there's no
address it could set. Make it a bit less confusing.

Signed-off-by: Pavel Machek <pavel@denx.de>

diff --git a/net/eth.c b/net/eth.c
index 99386e3..b72ae84 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -179,10 +179,12 @@ int eth_write_hwaddr(struct eth_device *dev, const char *base_name,
 			dev->name);
 	}
 
-	if (dev->write_hwaddr &&
-			!eth_mac_skip(eth_number)) {
-		if (!is_valid_ether_addr(dev->enetaddr))
+	if (dev->write_hwaddr && !eth_mac_skip(eth_number)) {
+		if (!is_valid_ether_addr(dev->enetaddr)) {
+			printf("\nError: %s ethernet address not valid: %pM\n",
+				 dev->name, dev->enetaddr);
 			return -1;
+		}
 
 		ret = dev->write_hwaddr(dev);
 	}

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

end of thread, other threads:[~2014-07-14 12:19 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-11  9:42 [U-Boot] [PATCH] Ethernet: let user know if there is no valid ethernet address Pavel Machek
2014-07-11  9:46 ` Marek Vasut
2014-07-11 10:43   ` Pavel Machek
2014-07-11 10:46     ` Marek Vasut
2014-07-11 10:52       ` Pavel Machek
2014-07-11 11:50         ` Marek Vasut
2014-07-14 12:19           ` Pavel Machek
2014-07-11 15:27 ` Wolfgang Denk
2014-07-11 16:32   ` Pavel Machek
2014-07-11 19:13     ` Wolfgang Denk
2014-07-11 20:30       ` Pavel Machek
2014-07-11 21:24         ` Tom Rini
2014-07-12  7:46         ` Wolfgang Denk
2014-07-13  8:27           ` [U-Boot] [PATCHv2] " Pavel Machek

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