aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/clock24xx.c
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2009-01-27 21:12:50 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-02-08 12:50:24 -0500
commitfecb494beef09e4caaa80313834af26f57091195 (patch)
tree4fc6d90c615a3e408f32c69916fcf5e7712f9d9a /arch/arm/mach-omap2/clock24xx.c
parent16c90f020034d3cd38b3dab280001e728e6b19e5 (diff)
[ARM] OMAP: Fix sparse, checkpatch warnings in OMAP2/3 PRCM/PM code
Fix sparse & checkpatch warnings in OMAP2/3 PRCM & PM code. This mostly consists of: - converting pointer comparisons to integers in form similar to (ptr == 0) to the standard idiom (!ptr) - labeling a few non-static private functions as static - adding prototypes for *_init() functions in the appropriate header files, and getting rid of the corresponding open-coded extern prototypes in other C files - renaming the variable 'sclk' in mach-omap2/clock.c:omap2_get_apll_clkin to avoid shadowing an earlier declaration Clean up checkpatch issues. This mostly involves: - converting some asm/ includes to linux/ includes - cleaning up some whitespace - getting rid of braces for conditionals with single following statements Also take care of a few odds and ends, including: - getting rid of unlikely() and likely() - none of this code is particularly fast-path code, so the performance impact seems slim; and some of those likely() and unlikely() indicators are probably not as accurate as the ARM's branch predictor - removing some superfluous casts linux-omap source commit is 347df59f5d20fdf905afbc26b1328b0e28a8a01b. Signed-off-by: Paul Walmsley <paul@pwsan.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-omap2/clock24xx.c')
-rw-r--r--arch/arm/mach-omap2/clock24xx.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/arch/arm/mach-omap2/clock24xx.c b/arch/arm/mach-omap2/clock24xx.c
index bd77ef2d5ae9..91ad2070264d 100644
--- a/arch/arm/mach-omap2/clock24xx.c
+++ b/arch/arm/mach-omap2/clock24xx.c
@@ -339,7 +339,7 @@ static const struct clkops clkops_fixed = {
339 * Uses the current prcm set to tell if a rate is valid. 339 * Uses the current prcm set to tell if a rate is valid.
340 * You can go slower, but not faster within a given rate set. 340 * You can go slower, but not faster within a given rate set.
341 */ 341 */
342long omap2_dpllcore_round_rate(unsigned long target_rate) 342static long omap2_dpllcore_round_rate(unsigned long target_rate)
343{ 343{
344 u32 high, low, core_clk_src; 344 u32 high, low, core_clk_src;
345 345
@@ -550,7 +550,9 @@ static int omap2_select_table_rate(struct clk *clk, unsigned long rate)
550 550
551 /* Major subsystem dividers */ 551 /* Major subsystem dividers */
552 tmp = cm_read_mod_reg(CORE_MOD, CM_CLKSEL1) & OMAP24XX_CLKSEL_DSS2_MASK; 552 tmp = cm_read_mod_reg(CORE_MOD, CM_CLKSEL1) & OMAP24XX_CLKSEL_DSS2_MASK;
553 cm_write_mod_reg(prcm->cm_clksel1_core | tmp, CORE_MOD, CM_CLKSEL1); 553 cm_write_mod_reg(prcm->cm_clksel1_core | tmp, CORE_MOD,
554 CM_CLKSEL1);
555
554 if (cpu_is_omap2430()) 556 if (cpu_is_omap2430())
555 cm_write_mod_reg(prcm->cm_clksel_mdm, 557 cm_write_mod_reg(prcm->cm_clksel_mdm,
556 OMAP2430_MDM_MOD, CM_CLKSEL); 558 OMAP2430_MDM_MOD, CM_CLKSEL);
@@ -582,20 +584,20 @@ static struct clk_functions omap2_clk_functions = {
582 584
583static u32 omap2_get_apll_clkin(void) 585static u32 omap2_get_apll_clkin(void)
584{ 586{
585 u32 aplls, sclk = 0; 587 u32 aplls, srate = 0;
586 588
587 aplls = cm_read_mod_reg(PLL_MOD, CM_CLKSEL1); 589 aplls = cm_read_mod_reg(PLL_MOD, CM_CLKSEL1);
588 aplls &= OMAP24XX_APLLS_CLKIN_MASK; 590 aplls &= OMAP24XX_APLLS_CLKIN_MASK;
589 aplls >>= OMAP24XX_APLLS_CLKIN_SHIFT; 591 aplls >>= OMAP24XX_APLLS_CLKIN_SHIFT;
590 592
591 if (aplls == APLLS_CLKIN_19_2MHZ) 593 if (aplls == APLLS_CLKIN_19_2MHZ)
592 sclk = 19200000; 594 srate = 19200000;
593 else if (aplls == APLLS_CLKIN_13MHZ) 595 else if (aplls == APLLS_CLKIN_13MHZ)
594 sclk = 13000000; 596 srate = 13000000;
595 else if (aplls == APLLS_CLKIN_12MHZ) 597 else if (aplls == APLLS_CLKIN_12MHZ)
596 sclk = 12000000; 598 srate = 12000000;
597 599
598 return sclk; 600 return srate;
599} 601}
600 602
601static u32 omap2_get_sysclkdiv(void) 603static u32 omap2_get_sysclkdiv(void)