Message ID | 20220708235530.1099185-1-linus.walleij@linaro.org (mailing list archive) |
---|---|
State | Accepted |
Commit | b3ba206ce84d3d5c963ea670c94d4de1335b6516 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next,1/2] ixp4xx_eth: Fall back to random MAC address | expand |
Hello: This series was applied to netdev/net-next.git (master) by David S. Miller <davem@davemloft.net>: On Sat, 9 Jul 2022 01:55:29 +0200 you wrote: > 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> > --- > drivers/net/ethernet/xscale/ixp4xx_eth.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) Here is the summary with links: - [net-next,1/2] ixp4xx_eth: Fall back to random MAC address https://git.kernel.org/netdev/net-next/c/b3ba206ce84d - [net-next,2/2] ixp4xx_eth: Set MAC address from device tree https://git.kernel.org/netdev/net-next/c/877d4e3cedd1 You are awesome, thank you!
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);
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> --- drivers/net/ethernet/xscale/ixp4xx_eth.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)