diff options
author | Jakub Kicinski <kuba@kernel.org> | 2021-10-13 13:44:35 -0700 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-10-14 09:22:27 -0700 |
commit | 923ca6f61887c9ed5797af096ffb23bdb6e4c6fa (patch) | |
tree | 8aa30e71b50c2a2c3f1d5b3b923631ed86ff814e /drivers/net/ethernet/3com/3c574_cs.c | |
parent | 562ef98a666eef8e32a6057af37a577163ab6946 (diff) | |
download | linux-923ca6f61887c9ed5797af096ffb23bdb6e4c6fa.tar.gz |
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/3com/3c574_cs.c')
-rw-r--r-- | drivers/net/ethernet/3com/3c574_cs.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/ethernet/3com/3c574_cs.c b/drivers/net/ethernet/3com/3c574_cs.c index dd4d3c48b98d..dc3b7c960611 100644 --- a/drivers/net/ethernet/3com/3c574_cs.c +++ b/drivers/net/ethernet/3com/3c574_cs.c @@ -305,15 +305,13 @@ static int tc574_config(struct pcmcia_device *link) struct net_device *dev = link->priv; struct el3_private *lp = netdev_priv(dev); int ret, i, j; + __be16 addr[ETH_ALEN / 2]; unsigned int ioaddr; - __be16 *phys_addr; char *cardname; __u32 config; u8 *buf; size_t len; - phys_addr = (__be16 *)dev->dev_addr; - dev_dbg(&link->dev, "3c574_config()\n"); link->io_lines = 16; @@ -347,19 +345,20 @@ static int tc574_config(struct pcmcia_device *link) len = pcmcia_get_tuple(link, 0x88, &buf); if (buf && len >= 6) { for (i = 0; i < 3; i++) - phys_addr[i] = htons(le16_to_cpu(buf[i * 2])); + addr[i] = htons(le16_to_cpu(buf[i * 2])); kfree(buf); } else { kfree(buf); /* 0 < len < 6 */ EL3WINDOW(0); for (i = 0; i < 3; i++) - phys_addr[i] = htons(read_eeprom(ioaddr, i + 10)); - if (phys_addr[0] == htons(0x6060)) { + addr[i] = htons(read_eeprom(ioaddr, i + 10)); + if (addr[0] == htons(0x6060)) { pr_notice("IO port conflict at 0x%03lx-0x%03lx\n", dev->base_addr, dev->base_addr+15); goto failed; } } + eth_hw_addr_set(dev, (u8 *)addr); if (link->prod_id[1]) cardname = link->prod_id[1]; else |