diff options
author | Jakub Kicinski <kuba@kernel.org> | 2021-10-16 00:53:04 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-10-18 15:20:38 +0300 |
commit | 4abd7cffc09a38015fa14a22471e3de48a4ca032 (patch) | |
tree | b6a0100f08a5de51263210934a6ce8f4fec1f4f0 /drivers/net/ethernet/natsemi/natsemi.c | |
parent | 0e9e7598c68f1dc17ce1053b08494b8ed6dd4985 (diff) | |
download | linux-4abd7cffc09a38015fa14a22471e3de48a4ca032.tar.xz |
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 <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/natsemi/natsemi.c')
-rw-r--r-- | drivers/net/ethernet/natsemi/natsemi.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/natsemi/natsemi.c b/drivers/net/ethernet/natsemi/natsemi.c index 3f982033944b..82a22711ce45 100644 --- a/drivers/net/ethernet/natsemi/natsemi.c +++ b/drivers/net/ethernet/natsemi/natsemi.c @@ -809,6 +809,7 @@ static int natsemi_probe1(struct pci_dev *pdev, const struct pci_device_id *ent) unsigned long iosize; void __iomem *ioaddr; const int pcibar = 1; /* PCI base address register */ + u8 addr[ETH_ALEN]; int prev_eedata; u32 tmp; @@ -859,10 +860,11 @@ static int natsemi_probe1(struct pci_dev *pdev, const struct pci_device_id *ent) prev_eedata = eeprom_read(ioaddr, 6); for (i = 0; i < 3; i++) { int eedata = eeprom_read(ioaddr, i + 7); - dev->dev_addr[i*2] = (eedata << 1) + (prev_eedata >> 15); - dev->dev_addr[i*2+1] = eedata >> 7; + addr[i*2] = (eedata << 1) + (prev_eedata >> 15); + addr[i*2+1] = eedata >> 7; prev_eedata = eedata; } + eth_hw_addr_set(dev, addr); np = netdev_priv(dev); np->ioaddr = ioaddr; |