diff options
author | Jakub Kicinski <kuba@kernel.org> | 2021-10-13 23:44:35 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-10-14 19:22:27 +0300 |
commit | 923ca6f61887c9ed5797af096ffb23bdb6e4c6fa (patch) | |
tree | 8aa30e71b50c2a2c3f1d5b3b923631ed86ff814e /drivers/net/ethernet/dec | |
parent | 562ef98a666eef8e32a6057af37a577163ab6946 (diff) | |
download | linux-923ca6f61887c9ed5797af096ffb23bdb6e4c6fa.tar.xz |
ethernet: replace netdev->dev_addr 16bit writes
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.
This patch takes care of drivers which cast netdev->dev_addr to
a 16bit type, often with an explicit byte order.
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/dec')
-rw-r--r-- | drivers/net/ethernet/dec/tulip/winbond-840.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/dec/tulip/winbond-840.c b/drivers/net/ethernet/dec/tulip/winbond-840.c index 85b99099c6b9..c4217ca5d709 100644 --- a/drivers/net/ethernet/dec/tulip/winbond-840.c +++ b/drivers/net/ethernet/dec/tulip/winbond-840.c @@ -355,6 +355,7 @@ static int w840_probe1(struct pci_dev *pdev, const struct pci_device_id *ent) int chip_idx = ent->driver_data; int irq; int i, option = find_cnt < MAX_UNITS ? options[find_cnt] : 0; + __le16 addr[ETH_ALEN / 2]; void __iomem *ioaddr; i = pcim_enable_device(pdev); @@ -382,7 +383,8 @@ static int w840_probe1(struct pci_dev *pdev, const struct pci_device_id *ent) goto err_out_netdev; for (i = 0; i < 3; i++) - ((__le16 *)dev->dev_addr)[i] = cpu_to_le16(eeprom_read(ioaddr, i)); + addr[i] = cpu_to_le16(eeprom_read(ioaddr, i)); + eth_hw_addr_set(dev, (u8 *)addr); /* Reset the chip to erase previous misconfiguration. No hold time required! */ |