summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/cirrus/cs89x0.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2021-10-04 19:05:21 +0300
committerDavid S. Miller <davem@davemloft.net>2021-10-05 15:16:48 +0300
commita05e4c0af490ca7c22fc77120aafebebdeaaf537 (patch)
tree093f856055c374789e43c55e5b4f8842e1f513fb /drivers/net/ethernet/cirrus/cs89x0.c
parent5e8fba848eaadb7394ffe88c0b2508ff2e2c9832 (diff)
downloadlinux-a05e4c0af490ca7c22fc77120aafebebdeaaf537.tar.xz
ethernet: use eth_hw_addr_set() for dev->addr_len cases
Convert all Ethernet drivers from memcpy(... dev->addr_len) to eth_hw_addr_set(): @@ expression dev, np; @@ - memcpy(dev->dev_addr, np, dev->addr_len) + eth_hw_addr_set(dev, np) In theory addr_len may not be ETH_ALEN, but we don't expect non-Ethernet devices to live under this directory, and only the following cases of setting addr_len exist: - cxgb4 for mgmt device, and the drivers which set it to ETH_ALEN: s2io, mlx4, vxge. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/cirrus/cs89x0.c')
-rw-r--r--drivers/net/ethernet/cirrus/cs89x0.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/cirrus/cs89x0.c b/drivers/net/ethernet/cirrus/cs89x0.c
index d0c4c8b7a15a..bd7920ab166f 100644
--- a/drivers/net/ethernet/cirrus/cs89x0.c
+++ b/drivers/net/ethernet/cirrus/cs89x0.c
@@ -1227,7 +1227,7 @@ static int set_mac_address(struct net_device *dev, void *p)
if (netif_running(dev))
return -EBUSY;
- memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
+ eth_hw_addr_set(dev, addr->sa_data);
cs89_dbg(0, debug, "%s: Setting MAC address to %pM\n",
dev->name, dev->dev_addr);