aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2009-04-23 23:11:06 -0400
committerpaul <paul@twilight.(none)>2009-04-23 23:11:06 -0400
commit15ca78f7925899fee7bc265651a69ab51f449eea (patch)
treec2ce118e98838115d742b162637779f13cd69683 /arch
parentc8088112fd96ad8b0f0bcd2f168fe6a17bf3cb41 (diff)
OMAP2xxx clock: fix broken cpu_mask code
Commit 8ad8ff6548f1c0bcbeaa02f274b3927c5015a921 breaks the OMAP2xxx cpu_mask code, which causes OMAP2xxx to panic on boot. Fix by removing the cpu_mask auto variable and by changing CK_242X and CK_243X to use RATE_IN_242X/RATE_IN_243X. Resolves <1>Unable to handle kernel NULL pointer dereference at virtual address 0000000c <1>pgd = c0004000 <1>[0000000c] *pgd=00000000 Internal error: Oops: 5 [#1] Modules linked in: CPU: 0 Not tainted (2.6.29-omap1 #32) PC is at omap2_clk_set_parent+0x104/0x120 LR is at omap2_clk_set_parent+0x28/0x120 Signed-off-by: Paul Walmsley <paul@pwsan.com> Tested-by: Jarkko Nikula <jarkko.nikula@nokia.com> Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap2/clock24xx.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/arch/arm/mach-omap2/clock24xx.c b/arch/arm/mach-omap2/clock24xx.c
index 984fb86349ba..5ea418327e89 100644
--- a/arch/arm/mach-omap2/clock24xx.c
+++ b/arch/arm/mach-omap2/clock24xx.c
@@ -60,8 +60,8 @@ struct omap_clk {
60 }, \ 60 }, \
61 } 61 }
62 62
63#define CK_243X (1 << 0) 63#define CK_243X RATE_IN_243X
64#define CK_242X (1 << 1) 64#define CK_242X RATE_IN_242X
65 65
66static struct omap_clk omap24xx_clks[] = { 66static struct omap_clk omap24xx_clks[] = {
67 /* external root sources */ 67 /* external root sources */
@@ -711,7 +711,7 @@ int __init omap2_clk_init(void)
711{ 711{
712 struct prcm_config *prcm; 712 struct prcm_config *prcm;
713 struct omap_clk *c; 713 struct omap_clk *c;
714 u32 clkrate, cpu_mask; 714 u32 clkrate;
715 715
716 if (cpu_is_omap242x()) 716 if (cpu_is_omap242x())
717 cpu_mask = RATE_IN_242X; 717 cpu_mask = RATE_IN_242X;
@@ -728,12 +728,6 @@ int __init omap2_clk_init(void)
728 sys_ck.rate = omap2_sys_clk_recalc(&sys_ck); 728 sys_ck.rate = omap2_sys_clk_recalc(&sys_ck);
729 propagate_rate(&sys_ck); 729 propagate_rate(&sys_ck);
730 730
731 cpu_mask = 0;
732 if (cpu_is_omap2420())
733 cpu_mask |= CK_242X;
734 if (cpu_is_omap2430())
735 cpu_mask |= CK_243X;
736
737 for (c = omap24xx_clks; c < omap24xx_clks + ARRAY_SIZE(omap24xx_clks); c++) 731 for (c = omap24xx_clks; c < omap24xx_clks + ARRAY_SIZE(omap24xx_clks); c++)
738 if (c->cpu & cpu_mask) { 732 if (c->cpu & cpu_mask) {
739 clkdev_add(&c->lk); 733 clkdev_add(&c->lk);