1 From 763716a55cb1f480ffe1a9702e6b5d9ea1a80a24 Mon Sep 17 00:00:00 2001
2 From: Matthew Hagan <mnhagan88@gmail.com>
3 Date: Sat, 25 Sep 2021 11:36:27 +0000
4 Subject: [PATCH] net: bgmac-platform: handle mac-address deferral
6 This patch is a replication of Christian Lamparter's "net: bgmac-bcma:
7 handle deferred probe error due to mac-address" patch for the
8 bgmac-platform driver [1].
10 As is the case with the bgmac-bcma driver, this change is to cover the
11 scenario where the MAC address cannot yet be discovered due to reliance
12 on an nvmem provider which is yet to be instantiated, resulting in a
13 random address being assigned that has to be manually overridden.
15 [1] https://lore.kernel.org/netdev/20210919115725.29064-1-chunkeey@gmail.com
17 Signed-off-by: Matthew Hagan <mnhagan88@gmail.com>
18 Reviewed-by: Andrew Lunn <andrew@lunn.ch>
19 Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
20 Signed-off-by: David S. Miller <davem@davemloft.net>
22 drivers/net/ethernet/broadcom/bgmac-platform.c | 3 +++
23 1 file changed, 3 insertions(+)
25 --- a/drivers/net/ethernet/broadcom/bgmac-platform.c
26 +++ b/drivers/net/ethernet/broadcom/bgmac-platform.c
27 @@ -193,6 +193,9 @@ static int bgmac_probe(struct platform_d
28 bgmac->dma_dev = &pdev->dev;
30 ret = of_get_mac_address(np, bgmac->net_dev->dev_addr);
31 + if (ret == -EPROBE_DEFER)
36 "MAC address not present in device tree\n");