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 | dc7daf33626d1f4afc97505516f824caf440d52c (patch) | |
tree | 15daa531f01830a97659f46445b467c735c6a91c /arch/mn10300 | |
parent | 817890ba15df44181bc9c2bf7527cb066ebae06f (diff) |
MN10300: Use clockevents_calc_mult_shift()
Use clockevents_calc_mult_shift() instead of the homebrewn function in
mn10300/kernel/time.c.
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/cevt-mn10300.c | 5 | ||||
-rw-r--r-- | arch/mn10300/kernel/internal.h | 7 | ||||
-rw-r--r-- | arch/mn10300/kernel/time.c | 17 |
3 files changed, 3 insertions, 26 deletions
diff --git a/arch/mn10300/kernel/cevt-mn10300.c b/arch/mn10300/kernel/cevt-mn10300.c index d4cb535bf786..9eb387adea7c 100644 --- a/arch/mn10300/kernel/cevt-mn10300.c +++ b/arch/mn10300/kernel/cevt-mn10300.c | |||
@@ -89,9 +89,10 @@ int __init init_clockevents(void) | |||
89 | cd->name = "Timestamp"; | 89 | cd->name = "Timestamp"; |
90 | cd->features = CLOCK_EVT_FEAT_ONESHOT; | 90 | cd->features = CLOCK_EVT_FEAT_ONESHOT; |
91 | 91 | ||
92 | /* Calculate the min / max delta */ | 92 | /* Calculate shift/mult. We want to spawn at least 1 second */ |
93 | clockevent_set_clock(cd, MN10300_JCCLK); | 93 | clockevents_calc_mult_shift(cd, MN10300_JCCLK, 1); |
94 | 94 | ||
95 | /* Calculate the min / max delta */ | ||
95 | cd->max_delta_ns = clockevent_delta2ns(TMJCBR_MAX, cd); | 96 | cd->max_delta_ns = clockevent_delta2ns(TMJCBR_MAX, cd); |
96 | cd->min_delta_ns = clockevent_delta2ns(100, cd); | 97 | cd->min_delta_ns = clockevent_delta2ns(100, cd); |
97 | 98 | ||
diff --git a/arch/mn10300/kernel/internal.h b/arch/mn10300/kernel/internal.h index 3d43d4dd0233..ea946613f46d 100644 --- a/arch/mn10300/kernel/internal.h +++ b/arch/mn10300/kernel/internal.h | |||
@@ -33,10 +33,3 @@ extern void mn10300_low_ipi_handler(void); | |||
33 | * time.c | 33 | * time.c |
34 | */ | 34 | */ |
35 | extern irqreturn_t local_timer_interrupt(void); | 35 | extern irqreturn_t local_timer_interrupt(void); |
36 | |||
37 | /* | ||
38 | * time.c | ||
39 | */ | ||
40 | #ifdef CONFIG_CSRC_MN10300 | ||
41 | extern void clocksource_set_clock(struct clocksource *, unsigned int); | ||
42 | #endif | ||
diff --git a/arch/mn10300/kernel/time.c b/arch/mn10300/kernel/time.c index 78f72080ca17..67c6416a58f8 100644 --- a/arch/mn10300/kernel/time.c +++ b/arch/mn10300/kernel/time.c | |||
@@ -93,23 +93,6 @@ irqreturn_t local_timer_interrupt(void) | |||
93 | return IRQ_HANDLED; | 93 | return IRQ_HANDLED; |
94 | } | 94 | } |
95 | 95 | ||
96 | void __cpuinit clockevent_set_clock(struct clock_event_device *cd, | ||
97 | unsigned int clock) | ||
98 | { | ||
99 | u64 temp; | ||
100 | u32 shift; | ||
101 | |||
102 | /* Find a shift value */ | ||
103 | for (shift = 32; shift > 0; shift--) { | ||
104 | temp = (u64) clock << shift; | ||
105 | do_div(temp, NSEC_PER_SEC); | ||
106 | if ((temp >> 32) == 0) | ||
107 | break; | ||
108 | } | ||
109 | cd->shift = shift; | ||
110 | cd->mult = (u32) temp; | ||
111 | } | ||
112 | |||
113 | /* | 96 | /* |
114 | * initialise the various timers used by the main part of the kernel | 97 | * initialise the various timers used by the main part of the kernel |
115 | */ | 98 | */ |