提交 1f7aa2bc 编写于 作者: H Heiner Kallweit 提交者: David S. Miller

r8169: simplify rtl_set_mac_address

Replace open-coded functionality with eth_mac_addr().
Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册