dmaengine: sh: usb-dmac: Fix pm_runtime_{enable,disable}() imbalance
authorGeert Uytterhoeven <geert+renesas@glider.be>
Sun, 25 Oct 2015 10:09:34 +0000 (11:09 +0100)
committerVinod Koul <vinod.koul@intel.com>
Mon, 16 Nov 2015 03:09:52 +0000 (08:39 +0530)
If the call to pm_runtime_get_sync() failed, Runtime PM was left
enabled.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/sh/usb-dmac.c

index f305738b5adf8cc9a246c286c0308d0d41dd3195..f1bcc2a163b30cef09b3d682b399037e2b9268c3 100644 (file)
@@ -802,7 +802,7 @@ static int usb_dmac_probe(struct platform_device *pdev)
        ret = pm_runtime_get_sync(&pdev->dev);
        if (ret < 0) {
                dev_err(&pdev->dev, "runtime PM get sync failed (%d)\n", ret);
-               return ret;
+               goto error_pm;
        }
 
        ret = usb_dmac_init(dmac);
@@ -859,6 +859,7 @@ static int usb_dmac_probe(struct platform_device *pdev)
 error:
        of_dma_controller_free(pdev->dev.of_node);
        pm_runtime_put(&pdev->dev);
+error_pm:
        pm_runtime_disable(&pdev->dev);
        return ret;
 }