diff options
author | Paul Mundt <lethal@linux-sh.org> | 2009-05-11 16:59:27 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-05-11 16:59:27 -0400 |
commit | f5c84cf50812c80133e64683d0500b2416d55cb3 (patch) | |
tree | eb116c797a5b56d96deeca62f5122d0de197f601 /arch/sh/kernel/cpu/sh4a/clock-sh7785.c | |
parent | aa87aa343f2cd236b5eccd643abd4df918ed5c4f (diff) |
sh: clkfwk: Tidy up on-chip clock registration and rate propagation.
This tidies up the set_rate hack that the on-chip clocks were abusing to
trigger rate propagation, which is now handled generically.
Additionally, now that CLK_ENABLE_ON_INIT is wired up where it needs to
be for these clocks, the clk_enable() can go away. In some cases this was
bumping up the refcount higher than it should have been.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/cpu/sh4a/clock-sh7785.c')
-rw-r--r-- | arch/sh/kernel/cpu/sh4a/clock-sh7785.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7785.c b/arch/sh/kernel/cpu/sh4a/clock-sh7785.c index edd432894bd9..4dcd1f6f0cbd 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7785.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7785.c | |||
@@ -137,26 +137,17 @@ static struct clk *sh7785_onchip_clocks[] = { | |||
137 | static int __init sh7785_clk_init(void) | 137 | static int __init sh7785_clk_init(void) |
138 | { | 138 | { |
139 | struct clk *clk = clk_get(NULL, "master_clk"); | 139 | struct clk *clk = clk_get(NULL, "master_clk"); |
140 | int i; | 140 | int i, ret = 0; |
141 | 141 | ||
142 | for (i = 0; i < ARRAY_SIZE(sh7785_onchip_clocks); i++) { | 142 | for (i = 0; i < ARRAY_SIZE(sh7785_onchip_clocks); i++) { |
143 | struct clk *clkp = sh7785_onchip_clocks[i]; | 143 | struct clk *clkp = sh7785_onchip_clocks[i]; |
144 | 144 | ||
145 | clkp->parent = clk; | 145 | clkp->parent = clk; |
146 | clk_register(clkp); | 146 | ret |= clk_register(clkp); |
147 | clk_enable(clkp); | ||
148 | } | 147 | } |
149 | 148 | ||
150 | /* | ||
151 | * Now that we have the rest of the clocks registered, we need to | ||
152 | * force the parent clock to propagate so that these clocks will | ||
153 | * automatically figure out their rate. We cheat by handing the | ||
154 | * parent clock its current rate and forcing child propagation. | ||
155 | */ | ||
156 | clk_set_rate(clk, clk_get_rate(clk)); | ||
157 | |||
158 | clk_put(clk); | 149 | clk_put(clk); |
159 | 150 | ||
160 | return 0; | 151 | return ret; |
161 | } | 152 | } |
162 | arch_initcall(sh7785_clk_init); | 153 | arch_initcall(sh7785_clk_init); |