Browse Source

dmaengine: sh: usb-dmac: Fix pm_runtime_{enable,disable}() imbalance

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>
Geert Uytterhoeven 9 years ago
parent
commit
bf55555baa
1 changed files with 2 additions and 1 deletions
  1. 2 1
      drivers/dma/sh/usb-dmac.c

+ 2 - 1
drivers/dma/sh/usb-dmac.c

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