[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220824151724.2698107-1-saproj@gmail.com>
Date: Wed, 24 Aug 2022 18:17:24 +0300
From: Sergei Antonov <saproj@...il.com>
To: netdev@...r.kernel.org
Cc: andrew@...n.ch, olteanv@...il.com, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
tangbin@...s.chinamobile.com, caizhichao@...ong.com,
Sergei Antonov <saproj@...il.com>
Subject: [PATCH net-next] net: ftmac100: add an opportunity to get ethaddr from the platform
This driver always generated a random ethernet address. Leave it as a
fallback solution, but add a call to platform_get_ethdev_address().
Handle EPROBE_DEFER returned from platform_get_ethdev_address() to
retry when EEPROM is ready.
Signed-off-by: Sergei Antonov <saproj@...il.com>
---
drivers/net/ethernet/faraday/ftmac100.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/faraday/ftmac100.c b/drivers/net/ethernet/faraday/ftmac100.c
index 2e6524009b19..a9af5b4c45b6 100644
--- a/drivers/net/ethernet/faraday/ftmac100.c
+++ b/drivers/net/ethernet/faraday/ftmac100.c
@@ -1077,6 +1077,10 @@ static int ftmac100_probe(struct platform_device *pdev)
netdev->netdev_ops = &ftmac100_netdev_ops;
netdev->max_mtu = MAX_PKT_SIZE;
+ err = platform_get_ethdev_address(&pdev->dev, netdev);
+ if (err == -EPROBE_DEFER)
+ goto defer_get_mac;
+
platform_set_drvdata(pdev, netdev);
/* setup private data */
@@ -1138,6 +1142,7 @@ static int ftmac100_probe(struct platform_device *pdev)
release_resource(priv->res);
err_req_mem:
netif_napi_del(&priv->napi);
+defer_get_mac:
free_netdev(netdev);
err_alloc_etherdev:
return err;
--
2.34.1
Powered by blists - more mailing lists