Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 127773
b: refs/heads/master
c: 20f10aa
h: refs/heads/master
i:
  127771: 7812e0c
v: v3
  • Loading branch information
Wu Fengguang authored and David S. Miller committed Jan 6, 2009
1 parent 159d40e commit c06c11e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e1c096e251e52773afeffbbcb74d0a072be47ea3
refs/heads/master: 20f10aa07d8d4d43ae8e129c39a84e1670b0d5ab
9 changes: 8 additions & 1 deletion trunk/drivers/net/usb/dm9601.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ static int dm9601_set_mac_address(struct net_device *net, void *p)
static int dm9601_bind(struct usbnet *dev, struct usb_interface *intf)
{
int ret;
u8 mac[ETH_ALEN];

ret = usbnet_get_endpoints(dev, intf);
if (ret)
Expand All @@ -438,12 +439,18 @@ static int dm9601_bind(struct usbnet *dev, struct usb_interface *intf)
udelay(20);

/* read MAC */
if (dm_read(dev, DM_PHY_ADDR, ETH_ALEN, dev->net->dev_addr) < 0) {
if (dm_read(dev, DM_PHY_ADDR, ETH_ALEN, mac) < 0) {
printk(KERN_ERR "Error reading MAC address\n");
ret = -ENODEV;
goto out;
}

/*
* Overwrite the auto-generated address only with good ones.
*/
if (is_valid_ether_addr(mac))
memcpy(dev->net->dev_addr, mac, ETH_ALEN);

/* power up phy */
dm_write_reg(dev, DM_GPR_CTRL, 1);
dm_write_reg(dev, DM_GPR_DATA, 0);
Expand Down

0 comments on commit c06c11e

Please sign in to comment.