]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
sh: enable and disable clocks recursively
authorMagnus Damm <damm@igel.co.jp>
Fri, 31 Oct 2008 11:13:32 +0000 (20:13 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Mon, 22 Dec 2008 09:42:50 +0000 (18:42 +0900)
Recurse and make sure parent clocks get enabled/disabled.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/kernel/cpu/clock.c

index b7e46d5bba439057a6f503d72b509515554db89a..717056b3d4003039fe67ea80460fe86b9f9a0798 100644 (file)
@@ -117,6 +117,11 @@ int clk_enable(struct clk *clk)
        unsigned long flags;
        int ret;
 
+       if (!clk)
+               return -EINVAL;
+
+       clk_enable(clk->parent);
+
        spin_lock_irqsave(&clock_lock, flags);
        ret = __clk_enable(clk);
        spin_unlock_irqrestore(&clock_lock, flags);
@@ -147,9 +152,14 @@ void clk_disable(struct clk *clk)
 {
        unsigned long flags;
 
+       if (!clk)
+               return -EINVAL;
+
        spin_lock_irqsave(&clock_lock, flags);
        __clk_disable(clk);
        spin_unlock_irqrestore(&clock_lock, flags);
+
+       clk_disable(clk->parent);
 }
 EXPORT_SYMBOL_GPL(clk_disable);