dwc3_meson_g12a_probe() enables priv->vbus when the optional regulator is
present, but dwc3_meson_g12a_remove() does not perform the matching
regulator_disable(). The probe error path already disables the regulator
before rearming the reset control.
Disable priv->vbus in the remove path before reset_control_rearm() to
match the cleanup performed by the probe error path.
Fixes: c99993376f72 ("usb: dwc3: Add Amlogic G12A DWC3 glue")
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
---
drivers/usb/dwc3/dwc3-meson-g12a.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c
index 4d611c08e8a4..7ca6fb89027f 100644
--- a/drivers/usb/dwc3/dwc3-meson-g12a.c
+++ b/drivers/usb/dwc3/dwc3-meson-g12a.c
@@ -851,6 +851,9 @@ static void dwc3_meson_g12a_remove(struct platform_device *pdev)
pm_runtime_put_noidle(dev);
pm_runtime_set_suspended(dev);
+ if (priv->vbus)
+ regulator_disable(priv->vbus);
+
reset_control_rearm(priv->reset);
clk_bulk_disable_unprepare(priv->drvdata->num_clks,
base-commit: f03c39de3a1307371a4032757cd1732e91087c7d
--
2.43.0