733-v5.15-0002-net-bgmac-platform-handle-mac-address-deferral.patch 1.4 KB

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