Commit 1f7aa2bc authored by Heiner Kallweit's avatar Heiner Kallweit Committed by David S. Miller

r8169: simplify rtl_set_mac_address

Replace open-coded functionality with eth_mac_addr().
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 755f6633
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment