summaryrefslogtreecommitdiff
path: root/drivers/net/usb
diff options
context:
space:
mode:
authorWu Fengguang <fengguang.wu@intel.com>2009-01-08 10:47:01 -0800
committerDavid S. Miller <davem@davemloft.net>2009-01-08 10:47:01 -0800
commitf52deb0e8408515ecf58c330c93fa99b8cb53cb4 (patch)
tree5bd7452b0d925f348f52d0ed13970d782b7fdcfc /drivers/net/usb
parent4b9f8ec6e5e98779e8b3806a5f58267378ef57eb (diff)
dm9601: warn on invalid mac address
Add warnings on invalid mac address to help disclose/debug problems. Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Acked-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r--drivers/net/usb/dm9601.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c
index 63e97a387085..5b67bbf1987e 100644
--- a/drivers/net/usb/dm9601.c
+++ b/drivers/net/usb/dm9601.c
@@ -407,8 +407,11 @@ static int dm9601_set_mac_address(struct net_device *net, void *p)
struct sockaddr *addr = p;
struct usbnet *dev = netdev_priv(net);
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!is_valid_ether_addr(addr->sa_data)) {
+ dev_err(&net->dev, "not setting invalid mac address %pM\n",
+ addr->sa_data);
return -EINVAL;
+ }
memcpy(net->dev_addr, addr->sa_data, net->addr_len);
__dm9601_set_mac_address(dev);
@@ -455,8 +458,12 @@ static int dm9601_bind(struct usbnet *dev, struct usb_interface *intf)
*/
if (is_valid_ether_addr(mac))
memcpy(dev->net->dev_addr, mac, ETH_ALEN);
- else
+ else {
+ printk(KERN_WARNING
+ "dm9601: No valid MAC address in EEPROM, using %pM\n",
+ dev->net->dev_addr);
__dm9601_set_mac_address(dev);
+ }
/* power up phy */
dm_write_reg(dev, DM_GPR_CTRL, 1);