diff options
author | Jakub Kicinski <kuba@kernel.org> | 2021-10-01 14:32:20 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-10-02 14:18:25 +0100 |
commit | a96d317fb1a30b9f323548eb2ff05d4e4600ead9 (patch) | |
tree | af0fc5c39eef0461e5e15a6cf2f5d9eac93fd101 /drivers/net/ethernet/wiznet/w5100.c | |
parent | 2f23e5cef31414156c24b90e56dedc118feb9bf3 (diff) |
ethernet: use eth_hw_addr_set()
Convert all Ethernet drivers from memcpy(... ETH_ADDR)
to eth_hw_addr_set():
@@
expression dev, np;
@@
- memcpy(dev->dev_addr, np, ETH_ALEN)
+ eth_hw_addr_set(dev, np)
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/wiznet/w5100.c')
-rw-r--r-- | drivers/net/ethernet/wiznet/w5100.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/wiznet/w5100.c b/drivers/net/ethernet/wiznet/w5100.c index f974e70a82e8..88fc65ed0017 100644 --- a/drivers/net/ethernet/wiznet/w5100.c +++ b/drivers/net/ethernet/wiznet/w5100.c @@ -985,7 +985,7 @@ static int w5100_set_macaddr(struct net_device *ndev, void *addr) if (!is_valid_ether_addr(sock_addr->sa_data)) return -EADDRNOTAVAIL; - memcpy(ndev->dev_addr, sock_addr->sa_data, ETH_ALEN); + eth_hw_addr_set(ndev, sock_addr->sa_data); w5100_write_macaddr(priv); return 0; } @@ -1155,7 +1155,7 @@ int w5100_probe(struct device *dev, const struct w5100_ops *ops, INIT_WORK(&priv->restart_work, w5100_restart_work); if (mac_addr) - memcpy(ndev->dev_addr, mac_addr, ETH_ALEN); + eth_hw_addr_set(ndev, mac_addr); else eth_hw_addr_random(ndev); |