hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/drivers/usb/dwc2/platform.c
....@@ -121,13 +121,6 @@
121121 return 0;
122122 }
123123
124
-static void __dwc2_disable_regulators(void *data)
125
-{
126
- struct dwc2_hsotg *hsotg = data;
127
-
128
- regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), hsotg->supplies);
129
-}
130
-
131124 static int __dwc2_lowlevel_phy_enable(struct dwc2_hsotg *hsotg)
132125 {
133126 struct platform_device *pdev = to_platform_device(hsotg->dev);
....@@ -198,16 +191,10 @@
198191
199192 static int __dwc2_lowlevel_hw_enable(struct dwc2_hsotg *hsotg)
200193 {
201
- struct platform_device *pdev = to_platform_device(hsotg->dev);
202194 int ret;
203195
204196 ret = regulator_bulk_enable(ARRAY_SIZE(hsotg->supplies),
205197 hsotg->supplies);
206
- if (ret)
207
- return ret;
208
-
209
- ret = devm_add_action_or_reset(&pdev->dev,
210
- __dwc2_disable_regulators, hsotg);
211198 if (ret)
212199 return ret;
213200
....@@ -249,7 +236,7 @@
249236
250237 clk_bulk_disable_unprepare(hsotg->num_clks, hsotg->clks);
251238
252
- return 0;
239
+ return regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), hsotg->supplies);
253240 }
254241
255242 /**
....@@ -699,7 +686,7 @@
699686 error:
700687 pm_runtime_put_sync(hsotg->dev);
701688 pm_runtime_disable(hsotg->dev);
702
- if (hsotg->dr_mode != USB_DR_MODE_PERIPHERAL)
689
+ if (hsotg->ll_hw_enabled)
703690 dwc2_lowlevel_hw_disable(hsotg);
704691 return retval;
705692 }