]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
MN10300: Use clocksource_register_hz()
authorThomas Gleixner <tglx@linutronix.de>
Fri, 18 Mar 2011 16:52:50 +0000 (16:52 +0000)
committerDavid Howells <dhowells@redhat.com>
Fri, 18 Mar 2011 16:52:50 +0000 (16:52 +0000)
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>
arch/mn10300/kernel/csrc-mn10300.c
arch/mn10300/kernel/internal.h
arch/mn10300/kernel/time.c

index ba2f0c4d6e01c708309b5178c479c98eb152a5e2..45644cf18c41245904722c405d7faeff4861838a 100644 (file)
@@ -29,7 +29,6 @@ static struct clocksource clocksource_mn10300 = {
 int __init init_clocksource(void)
 {
        startup_timestamp_counter();
-       clocksource_set_clock(&clocksource_mn10300, MN10300_TSCCLK);
-       clocksource_register(&clocksource_mn10300);
+       clocksource_register_hz(&clocksource_mn10300, MN10300_TSCCLK);
        return 0;
 }
index 6a064ab5af0774b15887d9432209a9e2f9abe208..3d43d4dd02334e521f6d922e3b575566178d9de3 100644 (file)
@@ -37,9 +37,6 @@ extern irqreturn_t local_timer_interrupt(void);
 /*
  * time.c
  */
-#ifdef CONFIG_CEVT_MN10300
-extern void clockevent_set_clock(struct clock_event_device *, unsigned int);
-#endif
 #ifdef CONFIG_CSRC_MN10300
 extern void clocksource_set_clock(struct clocksource *, unsigned int);
 #endif
index 611696df816fad48b93d45dd3db58bdcf692388c..78f72080ca171a2b0645e31c596ce438ca1681d0 100644 (file)
@@ -93,22 +93,6 @@ irqreturn_t local_timer_interrupt(void)
        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,
                                    unsigned int clock)
 {