Skip to content

Commit

Permalink
net: bgmac-platform: handle mac-address deferral
Browse files Browse the repository at this point in the history
This patch is a replication of Christian Lamparter's "net: bgmac-bcma:
handle deferred probe error due to mac-address" patch for the
bgmac-platform driver [1].

As is the case with the bgmac-bcma driver, this change is to cover the
scenario where the MAC address cannot yet be discovered due to reliance
on an nvmem provider which is yet to be instantiated, resulting in a
random address being assigned that has to be manually overridden.

[1] https://lore.kernel.org/netdev/20210919115725.29064-1-chunkeey@gmail.com

Signed-off-by: Matthew Hagan <mnhagan88@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Matthew Hagan authored and David S. Miller committed Sep 27, 2021
1 parent 44b6aa2 commit 763716a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/ethernet/broadcom/bgmac-platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ static int bgmac_probe(struct platform_device *pdev)
bgmac->dma_dev = &pdev->dev;

ret = of_get_mac_address(np, bgmac->net_dev->dev_addr);
if (ret == -EPROBE_DEFER)
return ret;

if (ret)
dev_warn(&pdev->dev,
"MAC address not present in device tree\n");
Expand Down

0 comments on commit 763716a

Please sign in to comment.