提交 6c52f32d 编写于 作者: R Rajendra Nayak 提交者: Paul Walmsley

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: NRajendra Nayak <rnayak@ti.com>
Signed-off-by: NPaul Walmsley <paul@pwsan.com>
上级 4da71ae6
......@@ -261,7 +261,8 @@ void omap2_clk_disable(struct clk *clk)
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)
clkdm_clk_disable(clk->clkdm, clk);
......@@ -312,10 +313,13 @@ int omap2_clk_enable(struct clk *clk)
}
}
ret = clk->ops->enable(clk);
if (ret) {
WARN(1, "clock: %s: could not enable: %d\n", clk->name, ret);
goto oce_err3;
if (clk->ops && clk->ops->enable) {
ret = clk->ops->enable(clk);
if (ret) {
WARN(1, "clock: %s: could not enable: %d\n",
clk->name, ret);
goto oce_err3;
}
}
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册