diff options
author | Mikael Pettersson <mikpe@it.uu.se> | 2009-09-10 18:59:07 -0400 |
---|---|---|
committer | Krzysztof Hałasa <khc@pm.waw.pl> | 2009-09-21 13:20:03 -0400 |
commit | ceb69a899f0819bce825083bd487c6afacc0d1b4 (patch) | |
tree | f0578705aa05260585bb083a9f536af70177a91d /arch/arm/mach-ixp4xx/common.c | |
parent | 43c1266ce4dc06bfd236cec31e11e9ecd69c0bef (diff) |
ixp4xx: timer and clocks cleanups
This patch does a few simple cleanups of the ixp4xx timer
and clocksource/clockevent code in mach-ixp4xx/common.c:
- ixp4xx_clocksource_init() is static and always returns 0,
which is ignored by its only caller: make it return void
- ixp4xx_clockevent_init(): ditto
- ixp4xx_get_cycles() is only referenced locally: make it static
- use the ixp4xx_timer_irq.dev_id field to pass &clockevent_ixp4xx
to ixp4xx_timer_interrupt() via its dev_id parameter, allowing
the code in ixp4xx_timer_interrupt() to be smaller and faster
Tested on an ixp420 machine (ds101).
Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Diffstat (limited to 'arch/arm/mach-ixp4xx/common.c')
-rw-r--r-- | arch/arm/mach-ixp4xx/common.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c index 5083f03e9b5e..cfd52fb341cb 100644 --- a/arch/arm/mach-ixp4xx/common.c +++ b/arch/arm/mach-ixp4xx/common.c | |||
@@ -41,8 +41,8 @@ | |||
41 | #include <asm/mach/irq.h> | 41 | #include <asm/mach/irq.h> |
42 | #include <asm/mach/time.h> | 42 | #include <asm/mach/time.h> |
43 | 43 | ||
44 | static int __init ixp4xx_clocksource_init(void); | 44 | static void __init ixp4xx_clocksource_init(void); |
45 | static int __init ixp4xx_clockevent_init(void); | 45 | static void __init ixp4xx_clockevent_init(void); |
46 | static struct clock_event_device clockevent_ixp4xx; | 46 | static struct clock_event_device clockevent_ixp4xx; |
47 | 47 | ||
48 | /************************************************************************* | 48 | /************************************************************************* |
@@ -267,7 +267,7 @@ void __init ixp4xx_init_irq(void) | |||
267 | 267 | ||
268 | static irqreturn_t ixp4xx_timer_interrupt(int irq, void *dev_id) | 268 | static irqreturn_t ixp4xx_timer_interrupt(int irq, void *dev_id) |
269 | { | 269 | { |
270 | struct clock_event_device *evt = &clockevent_ixp4xx; | 270 | struct clock_event_device *evt = dev_id; |
271 | 271 | ||
272 | /* Clear Pending Interrupt by writing '1' to it */ | 272 | /* Clear Pending Interrupt by writing '1' to it */ |
273 | *IXP4XX_OSST = IXP4XX_OSST_TIMER_1_PEND; | 273 | *IXP4XX_OSST = IXP4XX_OSST_TIMER_1_PEND; |
@@ -281,6 +281,7 @@ static struct irqaction ixp4xx_timer_irq = { | |||
281 | .name = "timer1", | 281 | .name = "timer1", |
282 | .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, | 282 | .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, |
283 | .handler = ixp4xx_timer_interrupt, | 283 | .handler = ixp4xx_timer_interrupt, |
284 | .dev_id = &clockevent_ixp4xx, | ||
284 | }; | 285 | }; |
285 | 286 | ||
286 | void __init ixp4xx_timer_init(void) | 287 | void __init ixp4xx_timer_init(void) |
@@ -401,7 +402,7 @@ void __init ixp4xx_sys_init(void) | |||
401 | /* | 402 | /* |
402 | * clocksource | 403 | * clocksource |
403 | */ | 404 | */ |
404 | cycle_t ixp4xx_get_cycles(struct clocksource *cs) | 405 | static cycle_t ixp4xx_get_cycles(struct clocksource *cs) |
405 | { | 406 | { |
406 | return *IXP4XX_OSTS; | 407 | return *IXP4XX_OSTS; |
407 | } | 408 | } |
@@ -417,14 +418,12 @@ static struct clocksource clocksource_ixp4xx = { | |||
417 | 418 | ||
418 | unsigned long ixp4xx_timer_freq = FREQ; | 419 | unsigned long ixp4xx_timer_freq = FREQ; |
419 | EXPORT_SYMBOL(ixp4xx_timer_freq); | 420 | EXPORT_SYMBOL(ixp4xx_timer_freq); |
420 | static int __init ixp4xx_clocksource_init(void) | 421 | static void __init ixp4xx_clocksource_init(void) |
421 | { | 422 | { |
422 | clocksource_ixp4xx.mult = | 423 | clocksource_ixp4xx.mult = |
423 | clocksource_hz2mult(ixp4xx_timer_freq, | 424 | clocksource_hz2mult(ixp4xx_timer_freq, |
424 | clocksource_ixp4xx.shift); | 425 | clocksource_ixp4xx.shift); |
425 | clocksource_register(&clocksource_ixp4xx); | 426 | clocksource_register(&clocksource_ixp4xx); |
426 | |||
427 | return 0; | ||
428 | } | 427 | } |
429 | 428 | ||
430 | /* | 429 | /* |
@@ -480,7 +479,7 @@ static struct clock_event_device clockevent_ixp4xx = { | |||
480 | .set_next_event = ixp4xx_set_next_event, | 479 | .set_next_event = ixp4xx_set_next_event, |
481 | }; | 480 | }; |
482 | 481 | ||
483 | static int __init ixp4xx_clockevent_init(void) | 482 | static void __init ixp4xx_clockevent_init(void) |
484 | { | 483 | { |
485 | clockevent_ixp4xx.mult = div_sc(FREQ, NSEC_PER_SEC, | 484 | clockevent_ixp4xx.mult = div_sc(FREQ, NSEC_PER_SEC, |
486 | clockevent_ixp4xx.shift); | 485 | clockevent_ixp4xx.shift); |
@@ -491,5 +490,4 @@ static int __init ixp4xx_clockevent_init(void) | |||
491 | clockevent_ixp4xx.cpumask = cpumask_of(0); | 490 | clockevent_ixp4xx.cpumask = cpumask_of(0); |
492 | 491 | ||
493 | clockevents_register_device(&clockevent_ixp4xx); | 492 | clockevents_register_device(&clockevent_ixp4xx); |
494 | return 0; | ||
495 | } | 493 | } |