aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/amd/amd8111e.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2021-10-15 15:16:44 -0700
committerDavid S. Miller <davem@davemloft.net>2021-10-16 08:53:46 +0100
commitf98c50509a20114d443551926357b1cb08424ec5 (patch)
tree3ca66b8fd1b483b7fd4de6743de4e9ae3454713e /drivers/net/ethernet/amd/amd8111e.c
parentethernet: alteon: use eth_hw_addr_set() (diff)
downloadlinux-dev-f98c50509a20114d443551926357b1cb08424ec5.tar.xz
linux-dev-f98c50509a20114d443551926357b1cb08424ec5.zip
ethernet: amd: use eth_hw_addr_set()
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. Read the address into an array on the stack, then call eth_hw_addr_set(). Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/amd/amd8111e.c')
-rw-r--r--drivers/net/ethernet/amd/amd8111e.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/amd/amd8111e.c b/drivers/net/ethernet/amd/amd8111e.c
index 0b493467b042..9421afb950f7 100644
--- a/drivers/net/ethernet/amd/amd8111e.c
+++ b/drivers/net/ethernet/amd/amd8111e.c
@@ -1743,6 +1743,7 @@ static int amd8111e_probe_one(struct pci_dev *pdev,
unsigned long reg_addr, reg_len;
struct amd8111e_priv *lp;
struct net_device *dev;
+ u8 addr[ETH_ALEN];
err = pci_enable_device(pdev);
if (err) {
@@ -1809,7 +1810,8 @@ static int amd8111e_probe_one(struct pci_dev *pdev,
/* Initializing MAC address */
for (i = 0; i < ETH_ALEN; i++)
- dev->dev_addr[i] = readb(lp->mmio + PADR + i);
+ addr[i] = readb(lp->mmio + PADR + i);
+ eth_hw_addr_set(dev, addr);
/* Setting user defined parametrs */
lp->ext_phy_option = speed_duplex[card_idx];