diff options
author | Jakub Kicinski <kuba@kernel.org> | 2021-10-15 14:53:04 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-10-18 13:20:38 +0100 |
commit | 4abd7cffc09a38015fa14a22471e3de48a4ca032 (patch) | |
tree | b6a0100f08a5de51263210934a6ce8f4fec1f4f0 /drivers/net/ethernet/toshiba/tc35815.c | |
parent | 0e9e7598c68f1dc17ce1053b08494b8ed6dd4985 (diff) | |
download | lwn-4abd7cffc09a38015fa14a22471e3de48a4ca032.tar.gz lwn-4abd7cffc09a38015fa14a22471e3de48a4ca032.zip |
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/toshiba/tc35815.c')
-rw-r--r-- | drivers/net/ethernet/toshiba/tc35815.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/toshiba/tc35815.c b/drivers/net/ethernet/toshiba/tc35815.c index f8b9d10dc056..ce38f7515225 100644 --- a/drivers/net/ethernet/toshiba/tc35815.c +++ b/drivers/net/ethernet/toshiba/tc35815.c @@ -725,6 +725,7 @@ static int tc35815_init_dev_addr(struct net_device *dev) { struct tc35815_regs __iomem *tr = (struct tc35815_regs __iomem *)dev->base_addr; + u8 addr[ETH_ALEN]; int i; while (tc_readl(&tr->PROM_Ctl) & PROM_Busy) @@ -735,9 +736,10 @@ static int tc35815_init_dev_addr(struct net_device *dev) while (tc_readl(&tr->PROM_Ctl) & PROM_Busy) ; data = tc_readl(&tr->PROM_Data); - dev->dev_addr[i] = data & 0xff; - dev->dev_addr[i+1] = data >> 8; + addr[i] = data & 0xff; + addr[i+1] = data >> 8; } + eth_hw_addr_set(dev, addr); if (!is_valid_ether_addr(dev->dev_addr)) return tc35815_read_plat_dev_addr(dev); return 0; |