mirror of https://gitee.com/openkylin/linux.git
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:
parent
755f6633d6
commit
1f7aa2bc26
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue