summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2022-07-09 02:55:29 +0300
committerDavid S. Miller <davem@davemloft.net>2022-07-09 14:34:17 +0300
commitb3ba206ce84d3d5c963ea670c94d4de1335b6516 (patch)
tree208c606796158e67c627ec49081f13a7346b0761
parent44ac441a51a77717e7e66d75591be3aa971a7455 (diff)
downloadlinux-b3ba206ce84d3d5c963ea670c94d4de1335b6516.tar.xz
ixp4xx_eth: Fall back to random MAC address
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>
-rw-r--r--drivers/net/ethernet/xscale/ixp4xx_eth.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c
index 89770c2e0ffb..a5d1d8d12064 100644
--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c
+++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c
@@ -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);