ARM: bcmring: update clock source registration
authorRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 13 Dec 2010 13:16:39 +0000 (13:16 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Wed, 22 Dec 2010 22:44:25 +0000 (22:44 +0000)
In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
interfaces were added which simplify (and optimize) the selection of the
divisor shift/mult constants.  Switch over to using this new interface.

Acked-By: Scott Branden <sbranden@broadcom.com>
Acked-By: Jiandong Zheng <jdzheng@broadcom.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-bcmring/core.c

index d3f959e92b2dd2ef15e129a3bd79e52801811efe..b91b1b0fdff339705a654d481be3ad02e292ce30 100644 (file)
@@ -294,7 +294,6 @@ static struct clocksource clocksource_bcmring_timer1 = {
        .rating = 200,
        .read = bcmring_get_cycles_timer1,
        .mask = CLOCKSOURCE_MASK(32),
-       .shift = 20,
        .flags = CLOCK_SOURCE_IS_CONTINUOUS,
 };
 
@@ -303,7 +302,6 @@ static struct clocksource clocksource_bcmring_timer3 = {
        .rating = 100,
        .read = bcmring_get_cycles_timer3,
        .mask = CLOCKSOURCE_MASK(32),
-       .shift = 20,
        .flags = CLOCK_SOURCE_IS_CONTINUOUS,
 };
 
@@ -316,10 +314,8 @@ static int __init bcmring_clocksource_init(void)
        writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC,
               TIMER1_VA_BASE + TIMER_CTRL);
 
-       clocksource_bcmring_timer1.mult =
-           clocksource_khz2mult(TIMER1_FREQUENCY_MHZ * 1000,
-                                clocksource_bcmring_timer1.shift);
-       clocksource_register(&clocksource_bcmring_timer1);
+       clocksource_register_khz(&clocksource_bcmring_timer1,
+                                TIMER1_FREQUENCY_MHZ * 1000);
 
        /* setup timer3 as free-running clocksource */
        writel(0, TIMER3_VA_BASE + TIMER_CTRL);
@@ -328,10 +324,8 @@ static int __init bcmring_clocksource_init(void)
        writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC,
               TIMER3_VA_BASE + TIMER_CTRL);
 
-       clocksource_bcmring_timer3.mult =
-           clocksource_khz2mult(TIMER3_FREQUENCY_KHZ,
-                                clocksource_bcmring_timer3.shift);
-       clocksource_register(&clocksource_bcmring_timer3);
+       clocksource_register_khz(&clocksource_bcmring_timer3,
+                                TIMER3_FREQUENCY_KHZ);
 
        return 0;
 }