]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: at91: properly initialize timer
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>
Thu, 12 Mar 2015 12:07:30 +0000 (13:07 +0100)
committerNicolas Ferre <nicolas.ferre@atmel.com>
Mon, 16 Mar 2015 16:03:04 +0000 (17:03 +0100)
Use clocksource_of_init to initialize the system timer instead of relying on a
custom function.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
arch/arm/mach-at91/at91rm9200.c
arch/arm/mach-at91/at91rm9200_time.c
arch/arm/mach-at91/generic.h

index 7634e10bc5dc37fa37e69b4af738703008d66bb8..eaf58f88ef5dcd262a862e96b0656b03a31cf8b3 100644 (file)
@@ -23,12 +23,6 @@ static const struct at91_soc rm9200_socs[] = {
        { /* sentinel */ },
 };
 
-static void __init at91rm9200_dt_timer_init(void)
-{
-       of_clk_init(NULL);
-       at91rm9200_timer_init();
-}
-
 static void __init at91rm9200_dt_device_init(void)
 {
        struct soc_device *soc;
@@ -50,7 +44,6 @@ static const char *at91rm9200_dt_board_compat[] __initconst = {
 };
 
 DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200")
-       .init_time      = at91rm9200_dt_timer_init,
        .init_machine   = at91rm9200_dt_device_init,
        .dt_compat      = at91rm9200_dt_board_compat,
 MACHINE_END
index b00d09555f2b7662cb3262ace823a11ccb3fd5e5..7d062ab326740ff775cd30e8920acad34198ece6 100644 (file)
@@ -222,7 +222,7 @@ err:
 /*
  * ST (system timer) module supports both clockevents and clocksource.
  */
-void __init at91rm9200_timer_init(void)
+static void __init atmel_st_timer_init(struct device_node *node)
 {
        /* For device tree enabled device: initialize here */
        of_at91rm9200_st_init();
@@ -249,3 +249,5 @@ void __init at91rm9200_timer_init(void)
        /* register clocksource */
        clocksource_register_hz(&clk32k, AT91_SLOW_CLOCK);
 }
+CLOCKSOURCE_OF_DECLARE(atmel_st_timer, "atmel,at91rm9200-st",
+                      atmel_st_timer_init);
index 2b396c4e1fc1650b80dc0f44ea370e69b149b6d6..b0fa7dc7286d9dc120a79c77be70fe0adb365910 100644 (file)
@@ -18,9 +18,6 @@
 extern void __init at91_map_io(void);
 extern void __init at91_alt_map_io(void);
 
- /* Timer */
-extern void at91rm9200_timer_init(void);
-
 /* idle */
 extern void at91rm9200_idle(void);
 extern void at91sam9_idle(void);