diff options
Diffstat (limited to 'arch/sh/kernel/cpu/sh4')
-rw-r--r-- | arch/sh/kernel/cpu/sh4/clock-sh4-202.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/arch/sh/kernel/cpu/sh4/clock-sh4-202.c b/arch/sh/kernel/cpu/sh4/clock-sh4-202.c index 0caca9f99fe..435f4f12ffb 100644 --- a/arch/sh/kernel/cpu/sh4/clock-sh4-202.c +++ b/arch/sh/kernel/cpu/sh4/clock-sh4-202.c | |||
@@ -127,7 +127,7 @@ static int shoc_clk_set_rate(struct clk *clk, unsigned long rate, int algo_id) | |||
127 | frqcr3 |= tmp << 6; | 127 | frqcr3 |= tmp << 6; |
128 | ctrl_outl(frqcr3, CPG2_FRQCR3); | 128 | ctrl_outl(frqcr3, CPG2_FRQCR3); |
129 | 129 | ||
130 | return clk->parent->rate / frqcr3_divisors[tmp]; | 130 | clk->rate = clk->parent->rate / frqcr3_divisors[tmp]; |
131 | 131 | ||
132 | return 0; | 132 | return 0; |
133 | } | 133 | } |
@@ -153,28 +153,17 @@ static struct clk *sh4202_onchip_clocks[] = { | |||
153 | static int __init sh4202_clk_init(void) | 153 | static int __init sh4202_clk_init(void) |
154 | { | 154 | { |
155 | struct clk *clk = clk_get(NULL, "master_clk"); | 155 | struct clk *clk = clk_get(NULL, "master_clk"); |
156 | int i; | 156 | int i, ret = 0; |
157 | 157 | ||
158 | for (i = 0; i < ARRAY_SIZE(sh4202_onchip_clocks); i++) { | 158 | for (i = 0; i < ARRAY_SIZE(sh4202_onchip_clocks); i++) { |
159 | struct clk *clkp = sh4202_onchip_clocks[i]; | 159 | struct clk *clkp = sh4202_onchip_clocks[i]; |
160 | 160 | ||
161 | clkp->parent = clk; | 161 | clkp->parent = clk; |
162 | clk_register(clkp); | 162 | ret |= clk_register(clkp); |
163 | clk_enable(clkp); | ||
164 | } | 163 | } |
165 | 164 | ||
166 | /* | ||
167 | * Now that we have the rest of the clocks registered, we need to | ||
168 | * force the parent clock to propagate so that these clocks will | ||
169 | * automatically figure out their rate. We cheat by handing the | ||
170 | * parent clock its current rate and forcing child propagation. | ||
171 | */ | ||
172 | clk_set_rate(clk, clk_get_rate(clk)); | ||
173 | |||
174 | clk_put(clk); | 165 | clk_put(clk); |
175 | 166 | ||
176 | return 0; | 167 | return ret; |
177 | } | 168 | } |
178 | |||
179 | arch_initcall(sh4202_clk_init); | 169 | arch_initcall(sh4202_clk_init); |
180 | |||