summaryrefslogtreecommitdiff
path: root/arch/arm/plat-mxc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/plat-mxc')
-rwxr-xr-xarch/arm/plat-mxc/clock.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/arch/arm/plat-mxc/clock.c b/arch/arm/plat-mxc/clock.c
index ee4ea63d9fdc..93347eb14c69 100755
--- a/arch/arm/plat-mxc/clock.c
+++ b/arch/arm/plat-mxc/clock.c
@@ -225,10 +225,18 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
IS_ERR(parent) || clk->set_parent == NULL)
return ret;
- if (clk->usecount)
- clk_enable(parent);
-
mutex_lock(&clocks_mutex);
+
+ if (clk->usecount) {
+ if (in_interrupt()) {
+ printk(KERN_ERR " clk_enable cannot be called in an interrupt context\n");
+ dump_stack();
+ mutex_unlock(&clocks_mutex);
+ BUG();
+ }
+ __clk_enable(parent);
+ }
+
ret = clk->set_parent(clk, parent);
if (ret == 0) {
old = clk->parent;
@@ -236,10 +244,10 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
} else {
old = parent;
}
- mutex_unlock(&clocks_mutex);
-
if (clk->usecount)
- clk_disable(old);
+ __clk_disable(old);
+
+ mutex_unlock(&clocks_mutex);
return ret;
}