r8169: simplify rtl_set_mac_address

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>
This commit is contained in:
Heiner Kallweit 2018-03-20 07:45:33 +01:00 committed by David S. Miller
parent 755f6633d6
commit 1f7aa2bc26
1 changed files with 4 additions and 5 deletions

View 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;
int ret;
if (!is_valid_ether_addr(addr->sa_data))
return -EADDRNOTAVAIL;
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);