Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: smsc: use eth_hw_addr_set()

Commit 406f42fa0d3c ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+8 -4
+4 -2
drivers/net/usb/smsc75xx.c
··· 757 757 758 758 static void smsc75xx_init_mac_address(struct usbnet *dev) 759 759 { 760 + u8 addr[ETH_ALEN]; 761 + 760 762 /* maybe the boot loader passed the MAC address in devicetree */ 761 763 if (!platform_get_ethdev_address(&dev->udev->dev, dev->net)) { 762 764 if (is_valid_ether_addr(dev->net->dev_addr)) { ··· 769 767 } 770 768 771 769 /* try reading mac address from EEPROM */ 772 - if (smsc75xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN, 773 - dev->net->dev_addr) == 0) { 770 + if (smsc75xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN, addr) == 0) { 771 + eth_hw_addr_set(dev->net, addr); 774 772 if (is_valid_ether_addr(dev->net->dev_addr)) { 775 773 /* eeprom values are valid so use them */ 776 774 netif_dbg(dev, ifup, dev->net,
+4 -2
drivers/net/usb/smsc95xx.c
··· 755 755 756 756 static void smsc95xx_init_mac_address(struct usbnet *dev) 757 757 { 758 + u8 addr[ETH_ALEN]; 759 + 758 760 /* maybe the boot loader passed the MAC address in devicetree */ 759 761 if (!platform_get_ethdev_address(&dev->udev->dev, dev->net)) { 760 762 if (is_valid_ether_addr(dev->net->dev_addr)) { ··· 767 765 } 768 766 769 767 /* try reading mac address from EEPROM */ 770 - if (smsc95xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN, 771 - dev->net->dev_addr) == 0) { 768 + if (smsc95xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN, addr) == 0) { 769 + eth_hw_addr_set(dev->net, addr); 772 770 if (is_valid_ether_addr(dev->net->dev_addr)) { 773 771 /* eeprom values are valid so use them */ 774 772 netif_dbg(dev, ifup, dev->net, "MAC address read from EEPROM\n");