From: Paul Walmsley Date: Mon, 27 Aug 2007 08:39:00 +0000 (-0600) Subject: omap2 clock: remove superfluous omap2_propagate_rate() X-Git-Tag: v2.6.23-omap1~123 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=c6c918bd20163dcfa10d391c174621e86af0a993;p=linux-2.6-omap-h63xx.git omap2 clock: remove superfluous omap2_propagate_rate() omap2_propagate_rate() seems completely superfluous. It handles two cases. The first case is for non-fixed rate clocks. It assigns the parent's rate to the clock, and continues propagating the rate downwards. This can be handled by adding a RATE_PROPAGATES clock flag to the clock, if it wasn't there already, and by using followparent_recalc() directly as the recalc function. The second case is for fixed rate clocks. Here all we need to do is to call propagate_rate() directly, so, use that for the recalc function. Signed-off-by: Paul Walmsley Signed-off-by: Tony Lindgren --- diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index 61c08902157..b8d1efde928 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c @@ -143,14 +143,6 @@ static void omap2_fixed_divisor_recalc(struct clk *clk) propagate_rate(clk); } -static void omap2_propagate_rate(struct clk * clk) -{ - if (!(clk->flags & RATE_FIXED)) - clk->rate = clk->parent->rate; - - propagate_rate(clk); -} - static void omap2_set_osc_ck(int enable) { u32 pcc; diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h index 99ce5968f28..c675caff711 100644 --- a/arch/arm/mach-omap2/clock.h +++ b/arch/arm/mach-omap2/clock.h @@ -24,7 +24,6 @@ static void omap2_sys_clk_recalc(struct clk * clk); static void omap2_clksel_recalc(struct clk * clk); -static void omap2_propagate_rate(struct clk * clk); static void omap2_mpu_recalc(struct clk * clk); static int omap2_select_table_rate(struct clk * clk, unsigned long rate); static long omap2_round_to_table_rate(struct clk * clk, unsigned long rate); @@ -621,7 +620,7 @@ static struct clk alt_ck = { /* Typical 54M or 48M, may not exist */ .rate = 54000000, .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | RATE_FIXED | ALWAYS_ENABLED | RATE_PROPAGATES, - .recalc = &omap2_propagate_rate, + .recalc = &propagate_rate, }; /* @@ -646,7 +645,7 @@ static struct clk apll96_ck = { RATE_FIXED | RATE_PROPAGATES, .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), .enable_bit = OMAP24XX_EN_96M_PLL_SHIFT, - .recalc = &omap2_propagate_rate, + .recalc = &propagate_rate, }; static struct clk apll54_ck = { @@ -657,7 +656,7 @@ static struct clk apll54_ck = { RATE_FIXED | RATE_PROPAGATES, .enable_reg = OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), .enable_bit = OMAP24XX_EN_54M_PLL_SHIFT, - .recalc = &omap2_propagate_rate, + .recalc = &propagate_rate, }; /* @@ -671,7 +670,7 @@ static struct clk func_54m_ck = { RATE_FIXED | CM_PLL_SEL1 | RATE_PROPAGATES | PARENT_CONTROLS_CLOCK, .src_offset = OMAP24XX_54M_SOURCE_SHIFT, - .recalc = &omap2_propagate_rate, + .recalc = &propagate_rate, }; static struct clk core_ck = { @@ -679,7 +678,7 @@ static struct clk core_ck = { .parent = &dpll_ck, /* can also be 32k */ .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | ALWAYS_ENABLED | RATE_PROPAGATES, - .recalc = &omap2_propagate_rate, + .recalc = &followparent_recalc, }; static struct clk func_96m_ck = { @@ -689,7 +688,7 @@ static struct clk func_96m_ck = { .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | RATE_FIXED | RATE_PROPAGATES | PARENT_CONTROLS_CLOCK, - .recalc = &omap2_propagate_rate, + .recalc = &propagate_rate, }; static struct clk func_48m_ck = { @@ -700,7 +699,7 @@ static struct clk func_48m_ck = { RATE_FIXED | CM_PLL_SEL1 | RATE_PROPAGATES | PARENT_CONTROLS_CLOCK, .src_offset = OMAP24XX_48M_SOURCE_SHIFT, - .recalc = &omap2_propagate_rate, + .recalc = &propagate_rate, }; static struct clk func_12m_ck = { @@ -752,7 +751,7 @@ static struct clk emul_ck = { .flags = CLOCK_IN_OMAP242X, .enable_reg = OMAP24XX_PRCM_CLKEMUL_CTRL, .enable_bit = OMAP24XX_EMULATION_EN_SHIFT, - .recalc = &omap2_propagate_rate, + .recalc = &followparent_recalc, };