devm_clk_get is device managed and makes error handling and cleanup a bit simpler. Signed-off-by: Sachin Kamat <sachin.kamat@xxxxxxxxxx> --- drivers/media/platform/s5p-fimc/fimc-lite.c | 8 +------- 1 files changed, 1 insertions(+), 7 deletions(-) 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; } -- 1.7.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html