diff mbox

[3/6,media] s5p-fimc: Use devm_clk_get in fimc-lite.c

Message ID 1353671443-2978-4-git-send-email-sachin.kamat@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Sachin Kamat Nov. 23, 2012, 11:50 a.m. UTC
devm_clk_get is device managed and makes error handling and cleanup
a bit simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/media/platform/s5p-fimc/fimc-lite.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)
diff mbox

Patch

diff --git a/drivers/media/platform/s5p-fimc/fimc-lite.c b/drivers/media/platform/s5p-fimc/fimc-lite.c
index 70bcf39..02d0ff9 100644
--- a/drivers/media/platform/s5p-fimc/fimc-lite.c
+++ b/drivers/media/platform/s5p-fimc/fimc-lite.c
@@ -1382,23 +1382,17 @@  static void fimc_lite_clk_put(struct fimc_lite *fimc)
 		return;
 
 	clk_unprepare(fimc->clock);
-	clk_put(fimc->clock);
-	fimc->clock = NULL;
 }
 
 static int fimc_lite_clk_get(struct fimc_lite *fimc)
 {
 	int ret;
 
-	fimc->clock = clk_get(&fimc->pdev->dev, FLITE_CLK_NAME);
+	fimc->clock = devm_clk_get(&fimc->pdev->dev, FLITE_CLK_NAME);
 	if (IS_ERR(fimc->clock))
 		return PTR_ERR(fimc->clock);
 
 	ret = clk_prepare(fimc->clock);
-	if (ret < 0) {
-		clk_put(fimc->clock);
-		fimc->clock = NULL;
-	}
 	return ret;
 }