>From a51089b8ad13957ba72be2f411c06684225ab3e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= Date: Thu, 6 Dec 2012 20:33:25 +0100 Subject: [PATCH] smsc75xx: dont reset macaddress in open MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit usbnet_open calls the minidriver .reset function. Moving the macadress initialization to .bind to prevent the macaddress from changing every time the device is brought up in case a persistent macaddress is missing. Signed-off-by: Bjørn Mork --- drivers/net/usb/smsc75xx.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c index 1cbd936..971c679 100644 --- a/drivers/net/usb/smsc75xx.c +++ b/drivers/net/usb/smsc75xx.c @@ -1054,17 +1054,6 @@ static int smsc75xx_reset(struct usbnet *dev) netif_dbg(dev, ifup, dev->net, "PHY reset complete\n"); - smsc75xx_init_mac_address(dev); - - ret = smsc75xx_set_mac_address(dev); - if (ret < 0) { - netdev_warn(dev->net, "Failed to set mac address\n"); - return ret; - } - - netif_dbg(dev, ifup, dev->net, "MAC Address: %pM\n", - dev->net->dev_addr); - ret = smsc75xx_read_reg(dev, HW_CFG, &buf); if (ret < 0) { netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret); @@ -1428,6 +1417,14 @@ static int smsc75xx_bind(struct usbnet *dev, struct usb_interface *intf) netdev_warn(dev->net, "smsc75xx_reset error %d\n", ret); return ret; } + smsc75xx_init_mac_address(dev); + ret = smsc75xx_set_mac_address(dev); + if (ret < 0) { + netdev_warn(dev->net, "Failed to set mac address\n"); + return ret; + } + netif_dbg(dev, ifup, dev->net, "MAC Address: %pM\n", + dev->net->dev_addr); dev->net->netdev_ops = &smsc75xx_netdev_ops; dev->net->ethtool_ops = &smsc75xx_ethtool_ops; -- 1.7.10.4