summaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorRajendra Nayak <rnayak@ti.com>2011-02-25 15:48:36 -0700
committerPaul Walmsley <paul@pwsan.com>2011-02-25 16:09:52 -0700
commit6c52f32dcf1d76a95bda3a12d6be9a3102a2693c (patch)
treec970d72dab700ee0c87d9cb4ef10da3a3740d792 /arch/arm
parent4da71ae607fc657075286abd2774041ff4d00fe5 (diff)
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>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-omap2/clock.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index e9625fcf639..b1875965bb5 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -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;