Skip to content

Commit

Permalink
ixp4xx_eth: Fall back to random MAC address
Browse files Browse the repository at this point in the history
If the firmware does not provide a MAC address to the driver,
fall back to generating a random MAC address.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Linus Walleij authored and David S. Miller committed Jul 9, 2022
1 parent 44ac441 commit b3ba206
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/net/ethernet/xscale/ixp4xx_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1487,7 +1487,10 @@ static int ixp4xx_eth_probe(struct platform_device *pdev)

port->plat = plat;
npe_port_tab[NPE_ID(port->id)] = port;
eth_hw_addr_set(ndev, plat->hwaddr);
if (is_valid_ether_addr(plat->hwaddr))
eth_hw_addr_set(ndev, plat->hwaddr);
else
eth_hw_addr_random(ndev);

platform_set_drvdata(pdev, ndev);

Expand Down

0 comments on commit b3ba206

Please sign in to comment.