Commit 1d0d3d81 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Greg Kroah-Hartman

usb: dwc3: meson-g12a: Disable the regulator in the error handling path of the probe

If an error occurs after a successful 'regulator_enable()' call,
'regulator_disable()' must be called.

Fix the error handling path of the probe accordingly.

The remove function doesn't need to be fixed, because the
'regulator_disable()' call is already hidden in 'dwc3_meson_g12a_suspend()'
which is called via 'pm_runtime_set_suspended()' in the remove function.

Fixes: c9999337 ("usb: dwc3: Add Amlogic G12A DWC3 glue")
Reviewed-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Acked-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/79df054046224bbb0716a8c5c2082650290eec86.1621616013.git.christophe.jaillet@wanadoo.fr
Cc: stable <stable@vger.kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 80137c18
...@@ -772,13 +772,13 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev) ...@@ -772,13 +772,13 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev)
ret = priv->drvdata->usb_init(priv); ret = priv->drvdata->usb_init(priv);
if (ret) if (ret)
goto err_disable_clks; goto err_disable_regulator;
/* Init PHYs */ /* Init PHYs */
for (i = 0 ; i < PHY_COUNT ; ++i) { for (i = 0 ; i < PHY_COUNT ; ++i) {
ret = phy_init(priv->phys[i]); ret = phy_init(priv->phys[i]);
if (ret) if (ret)
goto err_disable_clks; goto err_disable_regulator;
} }
/* Set PHY Power */ /* Set PHY Power */
...@@ -816,6 +816,10 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev) ...@@ -816,6 +816,10 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev)
for (i = 0 ; i < PHY_COUNT ; ++i) for (i = 0 ; i < PHY_COUNT ; ++i)
phy_exit(priv->phys[i]); phy_exit(priv->phys[i]);
err_disable_regulator:
if (priv->vbus)
regulator_disable(priv->vbus);
err_disable_clks: err_disable_clks:
clk_bulk_disable_unprepare(priv->drvdata->num_clks, clk_bulk_disable_unprepare(priv->drvdata->num_clks,
priv->drvdata->clks); priv->drvdata->clks);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment