diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-03-18 12:52:50 -0400 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2011-03-18 12:52:50 -0400 |
commit | 817890ba15df44181bc9c2bf7527cb066ebae06f (patch) | |
tree | d6cf5a0e5a023894ab5fe8bdb1a64bdaf4c12f77 /arch/mn10300 | |
parent | 73a173a4117419892bd436e85a00a53aa22ad118 (diff) |
MN10300: Use clocksource_register_hz()
clocksource_register_hz() calculates the shift/mult pair for the
clocksource. Remove the mn10300 duplicate implementation.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: John Stultz <johnstul@us.ibm.com>
Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
Cc: Mark Salter <msalter@redhat.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'arch/mn10300')
-rw-r--r-- | arch/mn10300/kernel/csrc-mn10300.c | 3 | ||||
-rw-r--r-- | arch/mn10300/kernel/internal.h | 3 | ||||
-rw-r--r-- | arch/mn10300/kernel/time.c | 16 |
3 files changed, 1 insertions, 21 deletions
diff --git a/arch/mn10300/kernel/csrc-mn10300.c b/arch/mn10300/kernel/csrc-mn10300.c index ba2f0c4d6e0..45644cf18c4 100644 --- a/arch/mn10300/kernel/csrc-mn10300.c +++ b/arch/mn10300/kernel/csrc-mn10300.c | |||
@@ -29,7 +29,6 @@ static struct clocksource clocksource_mn10300 = { | |||
29 | int __init init_clocksource(void) | 29 | int __init init_clocksource(void) |
30 | { | 30 | { |
31 | startup_timestamp_counter(); | 31 | startup_timestamp_counter(); |
32 | clocksource_set_clock(&clocksource_mn10300, MN10300_TSCCLK); | 32 | clocksource_register_hz(&clocksource_mn10300, MN10300_TSCCLK); |
33 | clocksource_register(&clocksource_mn10300); | ||
34 | return 0; | 33 | return 0; |
35 | } | 34 | } |
diff --git a/arch/mn10300/kernel/internal.h b/arch/mn10300/kernel/internal.h index 6a064ab5af0..3d43d4dd023 100644 --- a/arch/mn10300/kernel/internal.h +++ b/arch/mn10300/kernel/internal.h | |||
@@ -37,9 +37,6 @@ extern irqreturn_t local_timer_interrupt(void); | |||
37 | /* | 37 | /* |
38 | * time.c | 38 | * time.c |
39 | */ | 39 | */ |
40 | #ifdef CONFIG_CEVT_MN10300 | ||
41 | extern void clockevent_set_clock(struct clock_event_device *, unsigned int); | ||
42 | #endif | ||
43 | #ifdef CONFIG_CSRC_MN10300 | 40 | #ifdef CONFIG_CSRC_MN10300 |
44 | extern void clocksource_set_clock(struct clocksource *, unsigned int); | 41 | extern void clocksource_set_clock(struct clocksource *, unsigned int); |
45 | #endif | 42 | #endif |
diff --git a/arch/mn10300/kernel/time.c b/arch/mn10300/kernel/time.c index 611696df816..78f72080ca1 100644 --- a/arch/mn10300/kernel/time.c +++ b/arch/mn10300/kernel/time.c | |||
@@ -93,22 +93,6 @@ irqreturn_t local_timer_interrupt(void) | |||
93 | return IRQ_HANDLED; | 93 | return IRQ_HANDLED; |
94 | } | 94 | } |
95 | 95 | ||
96 | void __init clocksource_set_clock(struct clocksource *cs, unsigned int clock) | ||
97 | { | ||
98 | u64 temp; | ||
99 | u32 shift; | ||
100 | |||
101 | /* Find a shift value */ | ||
102 | for (shift = 32; shift > 0; shift--) { | ||
103 | temp = (u64) NSEC_PER_SEC << shift; | ||
104 | do_div(temp, clock); | ||
105 | if ((temp >> 32) == 0) | ||
106 | break; | ||
107 | } | ||
108 | cs->shift = shift; | ||
109 | cs->mult = (u32) temp; | ||
110 | } | ||
111 | |||
112 | void __cpuinit clockevent_set_clock(struct clock_event_device *cd, | 96 | void __cpuinit clockevent_set_clock(struct clock_event_device *cd, |
113 | unsigned int clock) | 97 | unsigned int clock) |
114 | { | 98 | { |