diff options
author | Magnus Damm <damm@igel.co.jp> | 2008-10-31 07:13:32 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-12-22 04:42:50 -0500 |
commit | d12cfac146d2b512496bf974b83ee1210032065f (patch) | |
tree | a46c31fc18fbfcfb78d3fb0643409b0865a313d0 /arch | |
parent | 4a4a9be3ebdbf17957d29e3521f328a1145f9431 (diff) |
sh: enable and disable clocks recursively
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sh/kernel/cpu/clock.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/sh/kernel/cpu/clock.c b/arch/sh/kernel/cpu/clock.c index b7e46d5bba43..717056b3d400 100644 --- a/arch/sh/kernel/cpu/clock.c +++ b/arch/sh/kernel/cpu/clock.c | |||
@@ -117,6 +117,11 @@ int clk_enable(struct clk *clk) | |||
117 | unsigned long flags; | 117 | unsigned long flags; |
118 | int ret; | 118 | int ret; |
119 | 119 | ||
120 | if (!clk) | ||
121 | return -EINVAL; | ||
122 | |||
123 | clk_enable(clk->parent); | ||
124 | |||
120 | spin_lock_irqsave(&clock_lock, flags); | 125 | spin_lock_irqsave(&clock_lock, flags); |
121 | ret = __clk_enable(clk); | 126 | ret = __clk_enable(clk); |
122 | spin_unlock_irqrestore(&clock_lock, flags); | 127 | spin_unlock_irqrestore(&clock_lock, flags); |
@@ -147,9 +152,14 @@ void clk_disable(struct clk *clk) | |||
147 | { | 152 | { |
148 | unsigned long flags; | 153 | unsigned long flags; |
149 | 154 | ||
155 | if (!clk) | ||
156 | return -EINVAL; | ||
157 | |||
150 | spin_lock_irqsave(&clock_lock, flags); | 158 | spin_lock_irqsave(&clock_lock, flags); |
151 | __clk_disable(clk); | 159 | __clk_disable(clk); |
152 | spin_unlock_irqrestore(&clock_lock, flags); | 160 | spin_unlock_irqrestore(&clock_lock, flags); |
161 | |||
162 | clk_disable(clk->parent); | ||
153 | } | 163 | } |
154 | EXPORT_SYMBOL_GPL(clk_disable); | 164 | EXPORT_SYMBOL_GPL(clk_disable); |
155 | 165 | ||