From: Thomas Gleixner Date: Fri, 18 Mar 2011 16:52:50 +0000 (+0000) Subject: MN10300: Use clockevents_calc_mult_shift() X-Git-Tag: firefly_0821_release~7613^2~1809^2~23 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=dc7daf33626d1f4afc97505516f824caf440d52c;p=firefly-linux-kernel-4.4.55.git 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 Acked-by: John Stultz Cc: Koichi Yasutake Cc: Mark Salter Signed-off-by: David Howells --- 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) cd->name = "Timestamp"; cd->features = CLOCK_EVT_FEAT_ONESHOT; - /* Calculate the min / max delta */ - clockevent_set_clock(cd, MN10300_JCCLK); + /* Calculate shift/mult. We want to spawn at least 1 second */ + clockevents_calc_mult_shift(cd, MN10300_JCCLK, 1); + /* Calculate the min / max delta */ cd->max_delta_ns = clockevent_delta2ns(TMJCBR_MAX, cd); cd->min_delta_ns = clockevent_delta2ns(100, cd); 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); * time.c */ extern irqreturn_t local_timer_interrupt(void); - -/* - * time.c - */ -#ifdef CONFIG_CSRC_MN10300 -extern void clocksource_set_clock(struct clocksource *, unsigned int); -#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) return IRQ_HANDLED; } -void __cpuinit clockevent_set_clock(struct clock_event_device *cd, - unsigned int clock) -{ - u64 temp; - u32 shift; - - /* Find a shift value */ - for (shift = 32; shift > 0; shift--) { - temp = (u64) clock << shift; - do_div(temp, NSEC_PER_SEC); - if ((temp >> 32) == 0) - break; - } - cd->shift = shift; - cd->mult = (u32) temp; -} - /* * initialise the various timers used by the main part of the kernel */