Skip to content

Commit 764257d

Browse files
tmlindvinodkoul
authored andcommitted
phy: cpcap-usb: Fix warning for missing regulator_disable
On deferred probe, we will get the following splat: cpcap-usb-phy cpcap-usb-phy.0: could not initialize VBUS or ID IIO: -517 WARNING: CPU: 0 PID: 21 at drivers/regulator/core.c:2123 regulator_put+0x68/0x78 ... (regulator_put) from [<c068ebf0>] (release_nodes+0x1b4/0x1fc) (release_nodes) from [<c068a9a4>] (really_probe+0x104/0x4a0) (really_probe) from [<c068b034>] (driver_probe_device+0x58/0xb4) Signed-off-by: Tony Lindgren <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent ef019c5 commit 764257d

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

drivers/phy/motorola/phy-cpcap-usb.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -662,35 +662,42 @@ static int cpcap_usb_phy_probe(struct platform_device *pdev)
662662
generic_phy = devm_phy_create(ddata->dev, NULL, &ops);
663663
if (IS_ERR(generic_phy)) {
664664
error = PTR_ERR(generic_phy);
665-
return PTR_ERR(generic_phy);
665+
goto out_reg_disable;
666666
}
667667

668668
phy_set_drvdata(generic_phy, ddata);
669669

670670
phy_provider = devm_of_phy_provider_register(ddata->dev,
671671
of_phy_simple_xlate);
672-
if (IS_ERR(phy_provider))
673-
return PTR_ERR(phy_provider);
672+
if (IS_ERR(phy_provider)) {
673+
error = PTR_ERR(phy_provider);
674+
goto out_reg_disable;
675+
}
674676

675677
error = cpcap_usb_init_optional_pins(ddata);
676678
if (error)
677-
return error;
679+
goto out_reg_disable;
678680

679681
cpcap_usb_init_optional_gpios(ddata);
680682

681683
error = cpcap_usb_init_iio(ddata);
682684
if (error)
683-
return error;
685+
goto out_reg_disable;
684686

685687
error = cpcap_usb_init_interrupts(pdev, ddata);
686688
if (error)
687-
return error;
689+
goto out_reg_disable;
688690

689691
usb_add_phy_dev(&ddata->phy);
690692
atomic_set(&ddata->active, 1);
691693
schedule_delayed_work(&ddata->detect_work, msecs_to_jiffies(1));
692694

693695
return 0;
696+
697+
out_reg_disable:
698+
regulator_disable(ddata->vusb);
699+
700+
return error;
694701
}
695702

696703
static int cpcap_usb_phy_remove(struct platform_device *pdev)

0 commit comments

Comments
 (0)