Commit 817890ba authored by Thomas Gleixner's avatar Thomas Gleixner Committed by David Howells

MN10300: Use clocksource_register_hz()

clocksource_register_hz() calculates the shift/mult pair for the
clocksource. Remove the mn10300 duplicate implementation.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Acked-by: default avatarJohn Stultz <johnstul@us.ibm.com>
Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
Cc: Mark Salter <msalter@redhat.com>
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
parent 73a173a4
...@@ -29,7 +29,6 @@ static struct clocksource clocksource_mn10300 = { ...@@ -29,7 +29,6 @@ static struct clocksource clocksource_mn10300 = {
int __init init_clocksource(void) int __init init_clocksource(void)
{ {
startup_timestamp_counter(); startup_timestamp_counter();
clocksource_set_clock(&clocksource_mn10300, MN10300_TSCCLK); clocksource_register_hz(&clocksource_mn10300, MN10300_TSCCLK);
clocksource_register(&clocksource_mn10300);
return 0; return 0;
} }
...@@ -37,9 +37,6 @@ extern irqreturn_t local_timer_interrupt(void); ...@@ -37,9 +37,6 @@ extern irqreturn_t local_timer_interrupt(void);
/* /*
* time.c * time.c
*/ */
#ifdef CONFIG_CEVT_MN10300
extern void clockevent_set_clock(struct clock_event_device *, unsigned int);
#endif
#ifdef CONFIG_CSRC_MN10300 #ifdef CONFIG_CSRC_MN10300
extern void clocksource_set_clock(struct clocksource *, unsigned int); extern void clocksource_set_clock(struct clocksource *, unsigned int);
#endif #endif
...@@ -93,22 +93,6 @@ irqreturn_t local_timer_interrupt(void) ...@@ -93,22 +93,6 @@ irqreturn_t local_timer_interrupt(void)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
void __init clocksource_set_clock(struct clocksource *cs, unsigned int clock)
{
u64 temp;
u32 shift;
/* Find a shift value */
for (shift = 32; shift > 0; shift--) {
temp = (u64) NSEC_PER_SEC << shift;
do_div(temp, clock);
if ((temp >> 32) == 0)
break;
}
cs->shift = shift;
cs->mult = (u32) temp;
}
void __cpuinit clockevent_set_clock(struct clock_event_device *cd, void __cpuinit clockevent_set_clock(struct clock_event_device *cd,
unsigned int clock) unsigned int clock)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment