devm_clk_get() is a device managed function and makes error handling a bit simpler. Cc: Shaik Ameer Basha <shaik.ameer@xxxxxxxxxxx> Signed-off-by: Sachin Kamat <sachin.kamat@xxxxxxxxxx> --- drivers/media/platform/exynos-gsc/gsc-core.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c index 99ee1a9..b89afec 100644 --- a/drivers/media/platform/exynos-gsc/gsc-core.c +++ b/drivers/media/platform/exynos-gsc/gsc-core.c @@ -1006,8 +1006,6 @@ static void gsc_clk_put(struct gsc_dev *gsc) return; clk_unprepare(gsc->clock); - clk_put(gsc->clock); - gsc->clock = NULL; } static int gsc_clk_get(struct gsc_dev *gsc) @@ -1016,7 +1014,7 @@ static int gsc_clk_get(struct gsc_dev *gsc) dev_dbg(&gsc->pdev->dev, "gsc_clk_get Called\n"); - gsc->clock = clk_get(&gsc->pdev->dev, GSC_CLOCK_GATE_NAME); + gsc->clock = devm_clk_get(&gsc->pdev->dev, GSC_CLOCK_GATE_NAME); if (IS_ERR(gsc->clock)) { dev_err(&gsc->pdev->dev, "failed to get clock~~~: %s\n", GSC_CLOCK_GATE_NAME); @@ -1027,8 +1025,6 @@ static int gsc_clk_get(struct gsc_dev *gsc) if (ret < 0) { dev_err(&gsc->pdev->dev, "clock prepare failed for clock: %s\n", GSC_CLOCK_GATE_NAME); - clk_put(gsc->clock); - gsc->clock = NULL; goto err; } -- 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