All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] phy: cpcap-usb: Fix warning for missing regulator_disable
@ 2020-12-30 10:21 Tony Lindgren
  2021-01-04  7:30 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Tony Lindgren @ 2020-12-30 10:21 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul; +Cc: linux-kernel, linux-usb, linux-omap

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 <tony@atomide.com>
---
 drivers/phy/motorola/phy-cpcap-usb.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/drivers/phy/motorola/phy-cpcap-usb.c b/drivers/phy/motorola/phy-cpcap-usb.c
--- a/drivers/phy/motorola/phy-cpcap-usb.c
+++ b/drivers/phy/motorola/phy-cpcap-usb.c
@@ -662,35 +662,42 @@ static int cpcap_usb_phy_probe(struct platform_device *pdev)
 	generic_phy = devm_phy_create(ddata->dev, NULL, &ops);
 	if (IS_ERR(generic_phy)) {
 		error = PTR_ERR(generic_phy);
-		return PTR_ERR(generic_phy);
+		goto out_reg_disable;
 	}
 
 	phy_set_drvdata(generic_phy, ddata);
 
 	phy_provider = devm_of_phy_provider_register(ddata->dev,
 						     of_phy_simple_xlate);
-	if (IS_ERR(phy_provider))
-		return PTR_ERR(phy_provider);
+	if (IS_ERR(phy_provider)) {
+		error = PTR_ERR(phy_provider);
+		goto out_reg_disable;
+	}
 
 	error = cpcap_usb_init_optional_pins(ddata);
 	if (error)
-		return error;
+		goto out_reg_disable;
 
 	cpcap_usb_init_optional_gpios(ddata);
 
 	error = cpcap_usb_init_iio(ddata);
 	if (error)
-		return error;
+		goto out_reg_disable;
 
 	error = cpcap_usb_init_interrupts(pdev, ddata);
 	if (error)
-		return error;
+		goto out_reg_disable;
 
 	usb_add_phy_dev(&ddata->phy);
 	atomic_set(&ddata->active, 1);
 	schedule_delayed_work(&ddata->detect_work, msecs_to_jiffies(1));
 
 	return 0;
+
+out_reg_disable:
+	regulator_disable(ddata->vusb);
+
+	return error;
 }
 
 static int cpcap_usb_phy_remove(struct platform_device *pdev)
-- 
2.29.2

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] phy: cpcap-usb: Fix warning for missing regulator_disable
  2020-12-30 10:21 [PATCH] phy: cpcap-usb: Fix warning for missing regulator_disable Tony Lindgren
@ 2021-01-04  7:30 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2021-01-04  7:30 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Kishon Vijay Abraham I, linux-kernel, linux-usb, linux-omap

On 30-12-20, 12:21, Tony Lindgren wrote:
> 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)

Applied, thanks

-- 
~Vinod

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-04  7:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-30 10:21 [PATCH] phy: cpcap-usb: Fix warning for missing regulator_disable Tony Lindgren
2021-01-04  7:30 ` Vinod Koul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.