aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/dm9601.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/usb/dm9601.c')
-rw-r--r--drivers/net/usb/dm9601.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c
index 49a30bde7a89..63e97a387085 100644
--- a/drivers/net/usb/dm9601.c
+++ b/drivers/net/usb/dm9601.c
@@ -397,6 +397,11 @@ static void dm9601_set_multicast(struct net_device *net)
397 dm_write_reg_async(dev, DM_RX_CTRL, rx_ctl); 397 dm_write_reg_async(dev, DM_RX_CTRL, rx_ctl);
398} 398}
399 399
400static void __dm9601_set_mac_address(struct usbnet *dev)
401{
402 dm_write_async(dev, DM_PHY_ADDR, ETH_ALEN, dev->net->dev_addr);
403}
404
400static int dm9601_set_mac_address(struct net_device *net, void *p) 405static int dm9601_set_mac_address(struct net_device *net, void *p)
401{ 406{
402 struct sockaddr *addr = p; 407 struct sockaddr *addr = p;
@@ -406,7 +411,7 @@ static int dm9601_set_mac_address(struct net_device *net, void *p)
406 return -EINVAL; 411 return -EINVAL;
407 412
408 memcpy(net->dev_addr, addr->sa_data, net->addr_len); 413 memcpy(net->dev_addr, addr->sa_data, net->addr_len);
409 dm_write_async(dev, DM_PHY_ADDR, net->addr_len, net->dev_addr); 414 __dm9601_set_mac_address(dev);
410 415
411 return 0; 416 return 0;
412} 417}
@@ -450,6 +455,8 @@ static int dm9601_bind(struct usbnet *dev, struct usb_interface *intf)
450 */ 455 */
451 if (is_valid_ether_addr(mac)) 456 if (is_valid_ether_addr(mac))
452 memcpy(dev->net->dev_addr, mac, ETH_ALEN); 457 memcpy(dev->net->dev_addr, mac, ETH_ALEN);
458 else
459 __dm9601_set_mac_address(dev);
453 460
454 /* power up phy */ 461 /* power up phy */
455 dm_write_reg(dev, DM_GPR_CTRL, 1); 462 dm_write_reg(dev, DM_GPR_CTRL, 1);