Commit 15ca78f7 authored by Paul Walmsley's avatar Paul Walmsley Committed by paul

OMAP2xxx clock: fix broken cpu_mask code

Commit 8ad8ff65 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: default avatarPaul Walmsley <paul@pwsan.com>
Tested-by: default avatarJarkko Nikula <jarkko.nikula@nokia.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
parent c8088112
...@@ -60,8 +60,8 @@ struct omap_clk { ...@@ -60,8 +60,8 @@ struct omap_clk {
}, \ }, \
} }
#define CK_243X (1 << 0) #define CK_243X RATE_IN_243X
#define CK_242X (1 << 1) #define CK_242X RATE_IN_242X
static struct omap_clk omap24xx_clks[] = { static struct omap_clk omap24xx_clks[] = {
/* external root sources */ /* external root sources */
...@@ -711,7 +711,7 @@ int __init omap2_clk_init(void) ...@@ -711,7 +711,7 @@ int __init omap2_clk_init(void)
{ {
struct prcm_config *prcm; struct prcm_config *prcm;
struct omap_clk *c; struct omap_clk *c;
u32 clkrate, cpu_mask; u32 clkrate;
if (cpu_is_omap242x()) if (cpu_is_omap242x())
cpu_mask = RATE_IN_242X; cpu_mask = RATE_IN_242X;
...@@ -728,12 +728,6 @@ int __init omap2_clk_init(void) ...@@ -728,12 +728,6 @@ int __init omap2_clk_init(void)
sys_ck.rate = omap2_sys_clk_recalc(&sys_ck); sys_ck.rate = omap2_sys_clk_recalc(&sys_ck);
propagate_rate(&sys_ck); propagate_rate(&sys_ck);
cpu_mask = 0;
if (cpu_is_omap2420())
cpu_mask |= CK_242X;
if (cpu_is_omap2430())
cpu_mask |= CK_243X;
for (c = omap24xx_clks; c < omap24xx_clks + ARRAY_SIZE(omap24xx_clks); c++) for (c = omap24xx_clks; c < omap24xx_clks + ARRAY_SIZE(omap24xx_clks); c++)
if (c->cpu & cpu_mask) { if (c->cpu & cpu_mask) {
clkdev_add(&c->lk); clkdev_add(&c->lk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment