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