USB: dwc3: disable autosuspend on unbind
authorJohan Hovold <johan+linaro@kernel.org>
Tue, 4 Apr 2023 07:25:16 +0000 (09:25 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Apr 2023 08:18:06 +0000 (10:18 +0200)
Add the missing calls to disable autosuspend on probe errors and on
driver unbind.

Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20230404072524.19014-4-johan+linaro@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/core.c

index ad48b7ebd880f881298ca85719b665b14f813f54..bb737c3bd58affbe888591e0965493a0ecb42616 100644 (file)
@@ -1966,6 +1966,7 @@ err3:
 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:
@@ -1993,6 +1994,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);