drv_data->clk = devm_clk_get(&pd->dev, NULL);
if (IS_ERR(drv_data->clk) && PTR_ERR(drv_data->clk) == -EPROBE_DEFER)
return -EPROBE_DEFER;
- if (!IS_ERR(drv_data->clk)) {
- clk_prepare(drv_data->clk);
- clk_enable(drv_data->clk);
- }
+ if (!IS_ERR(drv_data->clk))
+ clk_prepare_enable(drv_data->clk);
#endif
if (pdata) {
drv_data->freq_m = pdata->freq_m;
exit_clk:
#if defined(CONFIG_HAVE_CLK)
/* Not all platforms have a clk */
- if (!IS_ERR(drv_data->clk)) {
- clk_disable(drv_data->clk);
- clk_unprepare(drv_data->clk);
- }
+ if (!IS_ERR(drv_data->clk))
+ clk_disable_unprepare(drv_data->clk);
#endif
return rc;
}
reset_control_assert(drv_data->rstc);
#if defined(CONFIG_HAVE_CLK)
/* Not all platforms have a clk */
- if (!IS_ERR(drv_data->clk)) {
- clk_disable(drv_data->clk);
- clk_unprepare(drv_data->clk);
- }
+ if (!IS_ERR(drv_data->clk))
+ clk_disable_unprepare(drv_data->clk);
#endif
return 0;