Commit 6c52f32d authored by Rajendra Nayak's avatar Rajendra Nayak Committed by 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: default avatarRajendra Nayak <rnayak@ti.com>
Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
parent 4da71ae6
...@@ -261,6 +261,7 @@ void omap2_clk_disable(struct clk *clk) ...@@ -261,6 +261,7 @@ 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);
if (clk->ops && clk->ops->disable)
clk->ops->disable(clk); clk->ops->disable(clk);
if (clk->clkdm) if (clk->clkdm)
...@@ -312,11 +313,14 @@ int omap2_clk_enable(struct clk *clk) ...@@ -312,11 +313,14 @@ int omap2_clk_enable(struct clk *clk)
} }
} }
if (clk->ops && clk->ops->enable) {
ret = clk->ops->enable(clk); ret = clk->ops->enable(clk);
if (ret) { if (ret) {
WARN(1, "clock: %s: could not enable: %d\n", clk->name, ret); WARN(1, "clock: %s: could not enable: %d\n",
clk->name, ret);
goto oce_err3; goto oce_err3;
} }
}
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment