summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/dlink
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2021-10-13 13:44:35 -0700
committerJakub Kicinski <kuba@kernel.org>2021-10-14 09:22:27 -0700
commit923ca6f61887c9ed5797af096ffb23bdb6e4c6fa (patch)
tree8aa30e71b50c2a2c3f1d5b3b923631ed86ff814e /drivers/net/ethernet/dlink
parent562ef98a666eef8e32a6057af37a577163ab6946 (diff)
downloadlinux-923ca6f61887c9ed5797af096ffb23bdb6e4c6fa.tar.bz2
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/dlink')
-rw-r--r--drivers/net/ethernet/dlink/sundance.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/dlink/sundance.c b/drivers/net/ethernet/dlink/sundance.c
index 194b0812f7f6..c710dc17be90 100644
--- a/drivers/net/ethernet/dlink/sundance.c
+++ b/drivers/net/ethernet/dlink/sundance.c
@@ -508,6 +508,7 @@ static int sundance_probe1(struct pci_dev *pdev,
int bar = 1;
#endif
int phy, phy_end, phy_idx = 0;
+ __le16 addr[ETH_ALEN / 2];
if (pci_enable_device(pdev))
return -EIO;
@@ -528,8 +529,9 @@ static int sundance_probe1(struct pci_dev *pdev,
goto err_out_res;
for (i = 0; i < 3; i++)
- ((__le16 *)dev->dev_addr)[i] =
+ addr[i] =
cpu_to_le16(eeprom_read(ioaddr, i + EEPROM_SA_OFFSET));
+ eth_hw_addr_set(dev, (u8 *)addr);
np = netdev_priv(dev);
np->ndev = dev;