diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2018-03-20 07:45:33 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-03-22 11:47:51 -0400 |
commit | 1f7aa2bc268efe8c462f1d3f8778f9040047bc75 (patch) | |
tree | 213cd410de3dfec9203b2a1d558109a79bd37d69 /drivers/net | |
parent | 755f6633d64e5f428e5a6d13b446f1f42ee014a1 (diff) | |
download | linux-1f7aa2bc268efe8c462f1d3f8778f9040047bc75.tar.bz2 |
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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/realtek/r8169.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index 7055db161b1b..d4d2bb0c17ff 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c @@ -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); |