aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/cpu/clock.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-05-11 14:45:08 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-05-11 14:45:08 -0400
commitb68d8201433a91cabbcbeae48b53d8c1c426433a (patch)
treefed76b13249a01356509c0860260434216352f8c /arch/sh/kernel/cpu/clock.c
parentccc195655fb25d7d967b278c4a4725dc5e7a6bf4 (diff)
sh: clkfwk: Make recalc return an unsigned long.
This is prep work for cleaning up some of the rate propagation bits. Trivial conversion. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/cpu/clock.c')
-rw-r--r--arch/sh/kernel/cpu/clock.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/arch/sh/kernel/cpu/clock.c b/arch/sh/kernel/cpu/clock.c
index 133dbe40334..b022affb44c 100644
--- a/arch/sh/kernel/cpu/clock.c
+++ b/arch/sh/kernel/cpu/clock.c
@@ -75,6 +75,7 @@ static struct clk *onchip_clocks[] = {
75 &cpu_clk, 75 &cpu_clk,
76}; 76};
77 77
78/* Propagate rate to children */
78static void propagate_rate(struct clk *clk) 79static void propagate_rate(struct clk *clk)
79{ 80{
80 struct clk *clkp; 81 struct clk *clkp;
@@ -83,7 +84,7 @@ static void propagate_rate(struct clk *clk)
83 if (likely(clkp->parent != clk)) 84 if (likely(clkp->parent != clk))
84 continue; 85 continue;
85 if (likely(clkp->ops && clkp->ops->recalc)) 86 if (likely(clkp->ops && clkp->ops->recalc))
86 clkp->ops->recalc(clkp); 87 clkp->rate = clkp->ops->recalc(clkp);
87 if (unlikely(clkp->flags & CLK_RATE_PROPAGATES)) 88 if (unlikely(clkp->flags & CLK_RATE_PROPAGATES))
88 propagate_rate(clkp); 89 propagate_rate(clkp);
89 } 90 }
@@ -240,7 +241,7 @@ void clk_recalc_rate(struct clk *clk)
240 unsigned long flags; 241 unsigned long flags;
241 242
242 spin_lock_irqsave(&clock_lock, flags); 243 spin_lock_irqsave(&clock_lock, flags);
243 clk->ops->recalc(clk); 244 clk->rate = clk->ops->recalc(clk);
244 spin_unlock_irqrestore(&clock_lock, flags); 245 spin_unlock_irqrestore(&clock_lock, flags);
245 } 246 }
246 247
@@ -377,20 +378,22 @@ static int clks_sysdev_suspend(struct sys_device *dev, pm_message_t state)
377 switch (state.event) { 378 switch (state.event) {
378 case PM_EVENT_ON: 379 case PM_EVENT_ON:
379 /* Resumeing from hibernation */ 380 /* Resumeing from hibernation */
380 if (prev_state.event == PM_EVENT_FREEZE) { 381 if (prev_state.event != PM_EVENT_FREEZE)
381 list_for_each_entry(clkp, &clock_list, node) 382 break;
382 if (likely(clkp->ops)) { 383
383 unsigned long rate = clkp->rate; 384 list_for_each_entry(clkp, &clock_list, node) {
384 385 if (likely(clkp->ops)) {
385 if (likely(clkp->ops->set_parent)) 386 unsigned long rate = clkp->rate;
386 clkp->ops->set_parent(clkp, 387
387 clkp->parent); 388 if (likely(clkp->ops->set_parent))
388 if (likely(clkp->ops->set_rate)) 389 clkp->ops->set_parent(clkp,
389 clkp->ops->set_rate(clkp, 390 clkp->parent);
390 rate, NO_CHANGE); 391 if (likely(clkp->ops->set_rate))
391 else if (likely(clkp->ops->recalc)) 392 clkp->ops->set_rate(clkp,
392 clkp->ops->recalc(clkp); 393 rate, NO_CHANGE);
393 } 394 else if (likely(clkp->ops->recalc))
395 clkp->rate = clkp->ops->recalc(clkp);
396 }
394 } 397 }
395 break; 398 break;
396 case PM_EVENT_FREEZE: 399 case PM_EVENT_FREEZE: