From 1f7aa2bc268efe8c462f1d3f8778f9040047bc75 Mon Sep 17 00:00:00 2001 From: Heiner Kallweit Date: Tue, 20 Mar 2018 07:45:33 +0100 Subject: [PATCH] r8169: simplify rtl_set_mac_address Replace open-coded functionality with eth_mac_addr(). Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller --- drivers/net/ethernet/realtek/r8169.c | 9 ++++----- 1 file 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); -- 2.30.2