@@ -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;
}
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(-)