summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2024-09-11 01:09:13 +0300
committerJakub Kicinski <kuba@kernel.org>2024-09-12 02:03:14 +0300
commitb2d9544070d052804a12a7859aa212e952b96691 (patch)
treeaeca402bfd05ff8e7bb549531fb3a017285f3552 /drivers
parentcf06766f1525d35542cbb15fe6103caf44840376 (diff)
downloadlinux-b2d9544070d052804a12a7859aa212e952b96691.tar.xz
net: gianfar: fix NVMEM mac address
If nvmem loads after the ethernet driver, mac address assignments will not take effect. of_get_ethdev_address returns EPROBE_DEFER in such a case so we need to handle that to avoid eth_hw_addr_random. Signed-off-by: Rosen Penev <rosenp@gmail.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20240910220913.14101-1-rosenp@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/freescale/gianfar.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index 2baef59f741d..ecb1703ea150 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -754,6 +754,8 @@ static int gfar_of_init(struct platform_device *ofdev, struct net_device **pdev)
priv->device_flags |= FSL_GIANFAR_DEV_HAS_BUF_STASHING;
err = of_get_ethdev_address(np, dev);
+ if (err == -EPROBE_DEFER)
+ goto err_grp_init;
if (err) {
eth_hw_addr_random(dev);
dev_info(&ofdev->dev, "Using random MAC address: %pM\n", dev->dev_addr);