aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/clock.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-11-13 08:44:15 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-02-08 12:50:11 -0500
commit9a5fedac187f30116013a8420149d4ca11a44f0d (patch)
tree3cdcd9e8887a6fa41d1ddd85eb8c759990adc27b /arch/arm/plat-omap/clock.c
parenta9e882096317a088087b608d272da7029a6cc8c8 (diff)
[ARM] omap: move propagate_rate() calls into generic omap clock code
propagate_rate() is recursive, so it makes sense to minimise the amount of stack which is used for each recursion. So, rather than recursing back into it from the ->recalc functions if RATE_PROPAGATES is set, do that test at the higher level. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/plat-omap/clock.c')
-rw-r--r--arch/arm/plat-omap/clock.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
index b7137c560db4..df58f5d9a5ab 100644
--- a/arch/arm/plat-omap/clock.c
+++ b/arch/arm/plat-omap/clock.c
@@ -246,8 +246,6 @@ void followparent_recalc(struct clk *clk)
246 return; 246 return;
247 247
248 clk->rate = clk->parent->rate; 248 clk->rate = clk->parent->rate;
249 if (unlikely(clk->flags & RATE_PROPAGATES))
250 propagate_rate(clk);
251} 249}
252 250
253/* Propagate rate to children */ 251/* Propagate rate to children */
@@ -261,8 +259,10 @@ void propagate_rate(struct clk * tclk)
261 list_for_each_entry(clkp, &clocks, node) { 259 list_for_each_entry(clkp, &clocks, node) {
262 if (likely(clkp->parent != tclk)) 260 if (likely(clkp->parent != tclk))
263 continue; 261 continue;
264 if (likely((u32)clkp->recalc)) 262 if (clkp->recalc)
265 clkp->recalc(clkp); 263 clkp->recalc(clkp);
264 if (clkp->flags & RATE_PROPAGATES)
265 propagate_rate(clkp);
266 } 266 }
267} 267}
268 268
@@ -278,8 +278,12 @@ void recalculate_root_clocks(void)
278 struct clk *clkp; 278 struct clk *clkp;
279 279
280 list_for_each_entry(clkp, &clocks, node) { 280 list_for_each_entry(clkp, &clocks, node) {
281 if (unlikely(!clkp->parent) && likely((u32)clkp->recalc)) 281 if (!clkp->parent) {
282 clkp->recalc(clkp); 282 if (clkp->recalc)
283 clkp->recalc(clkp);
284 if (clkp->flags & RATE_PROPAGATES)
285 propagate_rate(clkp);
286 }
283 } 287 }
284} 288}
285 289