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/mipi-csis.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/s5p-fimc/mipi-csis.c b/drivers/media/platform/s5p-fimc/mipi-csis.c index 4c961b1..d624bfa 100644 --- a/drivers/media/platform/s5p-fimc/mipi-csis.c +++ b/drivers/media/platform/s5p-fimc/mipi-csis.c @@ -341,8 +341,6 @@ static void s5pcsis_clk_put(struct csis_state *state) if (IS_ERR_OR_NULL(state->clock[i])) continue; clk_unprepare(state->clock[i]); - clk_put(state->clock[i]); - state->clock[i] = NULL; } } @@ -352,13 +350,11 @@ static int s5pcsis_clk_get(struct csis_state *state) int i, ret; for (i = 0; i < NUM_CSIS_CLOCKS; i++) { - state->clock[i] = clk_get(dev, csi_clock_name[i]); + state->clock[i] = devm_clk_get(dev, csi_clock_name[i]); if (IS_ERR(state->clock[i])) goto err; ret = clk_prepare(state->clock[i]); if (ret < 0) { - clk_put(state->clock[i]); - state->clock[i] = 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