提交 ab4e4c07 编写于 作者: L Linus Walleij 提交者: David S. Miller

net: smsc911x: back out silently on probe deferrals

When trying to get a regulator we may get deferred and we see
this noise:

smsc911x 1b800000.ethernet-ebi2 (unnamed net_device) (uninitialized):
   couldn't get regulators -517

Then the driver continues anyway. Which means that the regulator
may not be properly retrieved and reference counted, and may be
switched off in case noone else is using it.

Fix this by returning silently on deferred probe and let the
system work it out.

Cc: Jeremy Linton <jeremy.linton@arm.com>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 7b596738
...@@ -438,9 +438,16 @@ static int smsc911x_request_resources(struct platform_device *pdev) ...@@ -438,9 +438,16 @@ static int smsc911x_request_resources(struct platform_device *pdev)
ret = regulator_bulk_get(&pdev->dev, ret = regulator_bulk_get(&pdev->dev,
ARRAY_SIZE(pdata->supplies), ARRAY_SIZE(pdata->supplies),
pdata->supplies); pdata->supplies);
if (ret) if (ret) {
/*
* Retry on deferrals, else just report the error
* and try to continue.
*/
if (ret == -EPROBE_DEFER)
return ret;
netdev_err(ndev, "couldn't get regulators %d\n", netdev_err(ndev, "couldn't get regulators %d\n",
ret); ret);
}
/* Request optional RESET GPIO */ /* Request optional RESET GPIO */
pdata->reset_gpiod = devm_gpiod_get_optional(&pdev->dev, pdata->reset_gpiod = devm_gpiod_get_optional(&pdev->dev,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册