]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
r8169: simplify rtl_set_mac_address
authorHeiner Kallweit <hkallweit1@gmail.com>
Tue, 20 Mar 2018 06:45:33 +0000 (07:45 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 22 Mar 2018 15:47:51 +0000 (11:47 -0400)
Replace open-coded functionality with eth_mac_addr().

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/realtek/r8169.c

index 7055db161b1b353d04c46683e861e36fed7e4a7d..d4d2bb0c17ffbce3020cc93a5136768aa8c201c6 100644 (file)
@@ -4616,12 +4616,11 @@ static int rtl_set_mac_address(struct net_device *dev, void *p)
 {
        struct rtl8169_private *tp = netdev_priv(dev);
        struct device *d = &tp->pci_dev->dev;
-       struct sockaddr *addr = p;
-
-       if (!is_valid_ether_addr(addr->sa_data))
-               return -EADDRNOTAVAIL;
+       int ret;
 
-       memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
+       ret = eth_mac_addr(dev, p);
+       if (ret)
+               return ret;
 
        pm_runtime_get_noresume(d);