提交 f7650d82 编写于 作者: S Sergei Antonov 提交者: Jakub Kicinski

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: NSergei Antonov <saproj@gmail.com>
Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20220824151724.2698107-1-saproj@gmail.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
上级 8532c60e
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册