diff options
author | Sergei Antonov <saproj@gmail.com> | 2022-08-24 17:17:24 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-08-27 04:26:11 +0200 |
commit | f7650d82e7dc501dfc5920c698bcc0591791a57c (patch) | |
tree | f7f68d51a7ebeb583e896d01de9caf9e11a506c0 /drivers/net/ethernet/faraday/ftmac100.c | |
parent | net: dsa: mv88e6xxx: Allow external SMI if serial (diff) | |
download | linux-f7650d82e7dc501dfc5920c698bcc0591791a57c.tar.xz linux-f7650d82e7dc501dfc5920c698bcc0591791a57c.zip |
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@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20220824151724.2698107-1-saproj@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | drivers/net/ethernet/faraday/ftmac100.c | 5 |
1 files changed, 5 insertions, 0 deletions
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 @@ err_ioremap: release_resource(priv->res); err_req_mem: netif_napi_del(&priv->napi); +defer_get_mac: free_netdev(netdev); err_alloc_etherdev: return err; |