All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: mv643xx_eth: handle EPROBE_DEFER
@ 2022-02-21  6:24 Mauri Sandberg
  2022-02-21 12:21 ` Andrew Lunn
  2022-02-23 14:23 ` [PATCH v2] net: mv643xx_eth: process retval from of_get_mac_address Mauri Sandberg
  0 siblings, 2 replies; 9+ messages in thread
From: Mauri Sandberg @ 2022-02-21  6:24 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: Sebastian Hesselbarth, David S. Miller, Jakub Kicinski, Mauri Sandberg

Obtaining MAC address may be deferred in cases when the MAC is stored
in NVMEM block and it may now be ready upon the first retrieval attempt
returing EPROBE_DEFER. Handle it here and leave logic otherwise as it
was.

Signed-off-by: Mauri Sandberg <maukka@ext.kapsi.fi>
---
 drivers/net/ethernet/marvell/mv643xx_eth.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 105247582684..0694f53981f2 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -2740,7 +2740,10 @@ static int mv643xx_eth_shared_of_add_port(struct platform_device *pdev,
 		return -EINVAL;
 	}
 
-	of_get_mac_address(pnp, ppd.mac_addr);
+	ret = of_get_mac_address(pnp, ppd.mac_addr);
+
+	if (ret == -EPROBE_DEFER)
+		return ret;
 
 	mv643xx_eth_property(pnp, "tx-queue-size", ppd.tx_queue_size);
 	mv643xx_eth_property(pnp, "tx-sram-addr", ppd.tx_sram_addr);

base-commit: cfb92440ee71adcc2105b0890bb01ac3cddb8507
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-02-24 18:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-21  6:24 [PATCH] net: mv643xx_eth: handle EPROBE_DEFER Mauri Sandberg
2022-02-21 12:21 ` Andrew Lunn
2022-02-21 18:25   ` Mauri Sandberg
2022-02-21 22:15     ` Andrew Lunn
2022-02-22  5:42       ` Mauri Sandberg
2022-02-23 14:23 ` [PATCH v2] net: mv643xx_eth: process retval from of_get_mac_address Mauri Sandberg
2022-02-24 16:57   ` Jakub Kicinski
2022-02-24 17:43     ` Andrew Lunn
2022-02-24 18:20   ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.