From 4abd7cffc09a38015fa14a22471e3de48a4ca032 Mon Sep 17 00:00:00 2001 From: Jakub Kicinski Date: Fri, 15 Oct 2021 14:53:04 -0700 Subject: ethernet: use eth_hw_addr_set() in unmaintained drivers Commit 406f42fa0d3c ("net-next: When a bond have a massive amount of VLANs...") introduced a rbtree for faster Ethernet address look up. To maintain netdev->dev_addr in this tree we need to make all the writes to it got through appropriate helpers. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller --- drivers/net/ethernet/cirrus/cs89x0.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'drivers/net/ethernet/cirrus') diff --git a/drivers/net/ethernet/cirrus/cs89x0.c b/drivers/net/ethernet/cirrus/cs89x0.c index bd7920ab166f..4a97aa8e1387 100644 --- a/drivers/net/ethernet/cirrus/cs89x0.c +++ b/drivers/net/ethernet/cirrus/cs89x0.c @@ -1314,6 +1314,7 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular) int tmp; unsigned rev_type = 0; int eeprom_buff[CHKSUM_LEN]; + u8 addr[ETH_ALEN]; int retval; /* Initialize the device structure. */ @@ -1387,9 +1388,10 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular) for (i = 0; i < ETH_ALEN / 2; i++) { unsigned int Addr; Addr = readreg(dev, PP_IA + i * 2); - dev->dev_addr[i * 2] = Addr & 0xFF; - dev->dev_addr[i * 2 + 1] = Addr >> 8; + addr[i * 2] = Addr & 0xFF; + addr[i * 2 + 1] = Addr >> 8; } + eth_hw_addr_set(dev, addr); /* Load the Adapter Configuration. * Note: Barring any more specific information from some @@ -1464,9 +1466,10 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular) /* eeprom_buff has 32-bit ints, so we can't just memcpy it */ /* store the initial memory base address */ for (i = 0; i < ETH_ALEN / 2; i++) { - dev->dev_addr[i * 2] = eeprom_buff[i]; - dev->dev_addr[i * 2 + 1] = eeprom_buff[i] >> 8; + addr[i * 2] = eeprom_buff[i]; + addr[i * 2 + 1] = eeprom_buff[i] >> 8; } + eth_hw_addr_set(dev, addr); cs89_dbg(1, debug, "%s: new adapter_cnf: 0x%x\n", dev->name, lp->adapter_cnf); } -- cgit v1.2.1