[PATCH 03/11] USB: dwc3: disable autosuspend on unbind

From: Johan Hovold
Date: Tue Apr 04 2023 - 03:26:08 EST


Add the missing calls to disable autosuspend on probe errors and on
driver unbind.

Signed-off-by: Johan Hovold <johan+linaro@xxxxxxxxxx>
---
drivers/usb/dwc3/core.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 9f8c988c25cb..5b362ed43e7e 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -1954,6 +1954,7 @@ static int dwc3_probe(struct platform_device *pdev)
err2:
pm_runtime_allow(dev);
pm_runtime_disable(dev);
+ pm_runtime_dont_use_autosuspend(dev);
pm_runtime_set_suspended(dev);
pm_runtime_put_noidle(dev);
disable_clks:
@@ -1981,6 +1982,7 @@ static int dwc3_remove(struct platform_device *pdev)

pm_runtime_allow(&pdev->dev);
pm_runtime_disable(&pdev->dev);
+ pm_runtime_dont_use_autosuspend(&pdev->dev);
pm_runtime_put_noidle(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev);

--
2.39.2