Skip to content

Commit ab4e4c0

Browse files
linuswdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7b59673 commit ab4e4c0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

drivers/net/ethernet/smsc/smsc911x.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,16 @@ static int smsc911x_request_resources(struct platform_device *pdev)
438438
ret = regulator_bulk_get(&pdev->dev,
439439
ARRAY_SIZE(pdata->supplies),
440440
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;
442448
netdev_err(ndev, "couldn't get regulators %d\n",
443449
ret);
450+
}
444451

445452
/* Request optional RESET GPIO */
446453
pdata->reset_gpiod = devm_gpiod_get_optional(&pdev->dev,

0 commit comments

Comments
 (0)