diff mbox

[5/6,media] s5p-jpeg: Use devm_clk_get APIs.

Message ID 1353671443-2978-6-git-send-email-sachin.kamat@linaro.org
State Deferred
Headers show

Commit Message

Sachin Kamat Nov. 23, 2012, 11:50 a.m. UTC
devm_clk_get() is device managed function and makes error handling
and exit code a bit simpler.

Cc: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/media/platform/s5p-jpeg/jpeg-core.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index 17983c4..fc63d27 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -1346,7 +1346,7 @@  static int s5p_jpeg_probe(struct platform_device *pdev)
 	}
 
 	/* clocks */
-	jpeg->clk = clk_get(&pdev->dev, "jpeg");
+	jpeg->clk = devm_clk_get(&pdev->dev, "jpeg");
 	if (IS_ERR(jpeg->clk)) {
 		dev_err(&pdev->dev, "cannot get clock\n");
 		ret = PTR_ERR(jpeg->clk);
@@ -1461,7 +1461,6 @@  device_register_rollback:
 
 clk_get_rollback:
 	clk_disable_unprepare(jpeg->clk);
-	clk_put(jpeg->clk);
 
 	return ret;
 }
@@ -1481,7 +1480,6 @@  static int s5p_jpeg_remove(struct platform_device *pdev)
 	v4l2_device_unregister(&jpeg->v4l2_dev);
 
 	clk_disable_unprepare(jpeg->clk);
-	clk_put(jpeg->clk);
 
 	return 0;
 }