mirror of https://gitee.com/openkylin/linux.git
omap: clock: Check for enable/disable ops support
Check if enable/disable operations are supported for a given clock node before attempting to call them. Signed-off-by: Rajendra Nayak <rnayak@ti.com> Signed-off-by: Paul Walmsley <paul@pwsan.com>
This commit is contained in:
parent
4da71ae607
commit
6c52f32dcf
|
@ -261,7 +261,8 @@ void omap2_clk_disable(struct clk *clk)
|
||||||
|
|
||||||
pr_debug("clock: %s: disabling in hardware\n", clk->name);
|
pr_debug("clock: %s: disabling in hardware\n", clk->name);
|
||||||
|
|
||||||
clk->ops->disable(clk);
|
if (clk->ops && clk->ops->disable)
|
||||||
|
clk->ops->disable(clk);
|
||||||
|
|
||||||
if (clk->clkdm)
|
if (clk->clkdm)
|
||||||
clkdm_clk_disable(clk->clkdm, clk);
|
clkdm_clk_disable(clk->clkdm, clk);
|
||||||
|
@ -312,10 +313,13 @@ int omap2_clk_enable(struct clk *clk)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = clk->ops->enable(clk);
|
if (clk->ops && clk->ops->enable) {
|
||||||
if (ret) {
|
ret = clk->ops->enable(clk);
|
||||||
WARN(1, "clock: %s: could not enable: %d\n", clk->name, ret);
|
if (ret) {
|
||||||
goto oce_err3;
|
WARN(1, "clock: %s: could not enable: %d\n",
|
||||||
|
clk->name, ret);
|
||||||
|
goto oce_err3;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue