Use devm_clk_get() to make cleanup paths more simple.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mutex_init(&imxdi->write_mutex);
- imxdi->clk = clk_get(&pdev->dev, NULL);
+ imxdi->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(imxdi->clk))
return PTR_ERR(imxdi->clk);
clk_prepare_enable(imxdi->clk);
err:
clk_disable_unprepare(imxdi->clk);
- clk_put(imxdi->clk);
return rc;
}
rtc_device_unregister(imxdi->rtc);
clk_disable_unprepare(imxdi->clk);
- clk_put(imxdi->clk);
return 0;
}