Skip to content

Commit

Permalink
ethernet: lpc: use eth_hw_addr_set()
Browse files Browse the repository at this point in the history
Commit 406f42f ("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>
  • Loading branch information
Jakub Kicinski authored and David S. Miller committed Oct 19, 2021
1 parent 4789b57 commit b814d32
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/ethernet/nxp/lpc_eth.c
Original file line number Diff line number Diff line change
@@ -1232,6 +1232,7 @@ static int lpc_eth_drv_probe(struct platform_device *pdev)
struct net_device *ndev;
dma_addr_t dma_handle;
struct resource *res;
u8 addr[ETH_ALEN];
int irq, ret;

/* Setup network interface for RMII or MII mode */
@@ -1347,7 +1348,8 @@ static int lpc_eth_drv_probe(struct platform_device *pdev)
pldat->phy_node = of_parse_phandle(np, "phy-handle", 0);

/* Get MAC address from current HW setting (POR state is all zeros) */
__lpc_get_mac(pldat, ndev->dev_addr);
__lpc_get_mac(pldat, addr);
eth_hw_addr_set(ndev, addr);

if (!is_valid_ether_addr(ndev->dev_addr)) {
of_get_ethdev_address(np, ndev);

0 comments on commit b814d32

Please sign in to comment.