aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2016-12-09 08:18:00 -0500
committerDavid S. Miller <davem@davemloft.net>2016-12-09 23:05:16 -0500
commitab4e4c07aca7b33f8d00c5d6b083a564660ca8a5 (patch)
tree5715298586d832ca3c47577df26681bb293bc9bc
parent7b5967389f5a8dfb9d32843830f5e2717e20995d (diff)
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: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/smsc/smsc911x.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c
index e9b8579e6241..8b0016a785c0 100644
--- a/drivers/net/ethernet/smsc/smsc911x.c
+++ b/drivers/net/ethernet/smsc/smsc911x.c
@@ -438,9 +438,16 @@ static int smsc911x_request_resources(struct platform_device *pdev)
438 ret = regulator_bulk_get(&pdev->dev, 438 ret = regulator_bulk_get(&pdev->dev,
439 ARRAY_SIZE(pdata->supplies), 439 ARRAY_SIZE(pdata->supplies),
440 pdata->supplies); 440 pdata->supplies);
441 if (ret) 441 if (ret) {
442 /*
443 * Retry on deferrals, else just report the error
444 * and try to continue.
445 */
446 if (ret == -EPROBE_DEFER)
447 return ret;
442 netdev_err(ndev, "couldn't get regulators %d\n", 448 netdev_err(ndev, "couldn't get regulators %d\n",
443 ret); 449 ret);
450 }
444 451
445 /* Request optional RESET GPIO */ 452 /* Request optional RESET GPIO */
446 pdata->reset_gpiod = devm_gpiod_get_optional(&pdev->dev, 453 pdata->reset_gpiod = devm_gpiod_get_optional(&pdev->dev,