diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2012-01-11 09:46:59 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-01-31 00:05:24 +0100 |
commit | b9576623c4217a5d753c272158e1e108c25a1a57 (patch) | |
tree | 0c6e4b503990c4b1fe6f48d50623603f0fddbf65 /arch/arm/plat-nomadik | |
parent | dcd6c92267155e70a94b3927bce681ce74b80d1f (diff) |
ARM: plat-nomadik: get rid of global mtu base pointer
Pass the base offset to the Nomadik MTU timer in the init call
instead of keeping a global pointer to be assigned.
Acked-by: Alessandro Rubini <rubini@unipv.it>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/plat-nomadik')
-rw-r--r-- | arch/arm/plat-nomadik/include/plat/mtu.h | 4 | ||||
-rw-r--r-- | arch/arm/plat-nomadik/timer.c | 6 |
2 files changed, 4 insertions, 6 deletions
diff --git a/arch/arm/plat-nomadik/include/plat/mtu.h b/arch/arm/plat-nomadik/include/plat/mtu.h index 6508e7694a4b..582641f3dc01 100644 --- a/arch/arm/plat-nomadik/include/plat/mtu.h +++ b/arch/arm/plat-nomadik/include/plat/mtu.h @@ -1,9 +1,7 @@ #ifndef __PLAT_MTU_H #define __PLAT_MTU_H -/* should be set by the platform code */ -extern void __iomem *mtu_base; - +void nmdk_timer_init(void __iomem *base); void nmdk_clkevt_reset(void); void nmdk_clksrc_reset(void); diff --git a/arch/arm/plat-nomadik/timer.c b/arch/arm/plat-nomadik/timer.c index ad1b45b605a4..46f50f24205f 100644 --- a/arch/arm/plat-nomadik/timer.c +++ b/arch/arm/plat-nomadik/timer.c @@ -66,12 +66,11 @@ #define MTU_PCELL2 0xff8 #define MTU_PCELL3 0xffC +static void __iomem *mtu_base; static bool clkevt_periodic; static u32 clk_prescale; static u32 nmdk_cycle; /* write-once */ -void __iomem *mtu_base; /* Assigned by machine code */ - #ifdef CONFIG_NOMADIK_MTU_SCHED_CLOCK /* * Override the global weak sched_clock symbol with this @@ -183,11 +182,12 @@ void nmdk_clksrc_reset(void) mtu_base + MTU_CR(0)); } -void __init nmdk_timer_init(void) +void __init nmdk_timer_init(void __iomem *base) { unsigned long rate; struct clk *clk0; + mtu_base = base; clk0 = clk_get_sys("mtu0", NULL); BUG_ON(IS_ERR(clk0)); |