mvebu: backport mainline patches from kernel 3.12
[openwrt.git] / target / linux / mvebu / patches-3.10 / 0083-clocksource-armada-370-xp-Use-CLOCKSOURCE_OF_DECLARE.patch
1 From 409885c9ec1b0dba5c8f393af6d481c69bfa9b0a Mon Sep 17 00:00:00 2001
2 From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
3 Date: Tue, 13 Aug 2013 11:43:12 -0300
4 Subject: [PATCH 083/203] clocksource: armada-370-xp: Use
5  CLOCKSOURCE_OF_DECLARE
6
7 This is almost cosmetic: we achieve a bit of consistency with
8 other clocksource drivers by using the CLOCKSOURCE_OF_DECLARE
9 macro for the boilerplate code.
10
11 Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
12 Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
13 Reviewed-by: Andrew Lunn <andrew@lunn.ch>
14 ---
15  arch/arm/mach-mvebu/armada-370-xp.c      |  4 ++--
16  drivers/clocksource/time-armada-370-xp.c |  6 +++---
17  include/linux/time-armada-370-xp.h       | 18 ------------------
18  3 files changed, 5 insertions(+), 23 deletions(-)
19  delete mode 100644 include/linux/time-armada-370-xp.h
20
21 --- a/arch/arm/mach-mvebu/armada-370-xp.c
22 +++ b/arch/arm/mach-mvebu/armada-370-xp.c
23 @@ -17,7 +17,7 @@
24  #include <linux/of_address.h>
25  #include <linux/of_platform.h>
26  #include <linux/io.h>
27 -#include <linux/time-armada-370-xp.h>
28 +#include <linux/clocksource.h>
29  #include <linux/clk/mvebu.h>
30  #include <linux/dma-mapping.h>
31  #include <linux/mbus.h>
32 @@ -38,7 +38,7 @@ static void __init armada_370_xp_map_io(
33  static void __init armada_370_xp_timer_and_clk_init(void)
34  {
35         mvebu_clocks_init();
36 -       armada_370_xp_timer_init();
37 +       clocksource_of_init();
38         coherency_init();
39         BUG_ON(mvebu_mbus_dt_init());
40  #ifdef CONFIG_CACHE_L2X0
41 --- a/drivers/clocksource/time-armada-370-xp.c
42 +++ b/drivers/clocksource/time-armada-370-xp.c
43 @@ -210,13 +210,11 @@ static struct local_timer_ops armada_370
44         .stop   =  armada_370_xp_timer_stop,
45  };
46  
47 -void __init armada_370_xp_timer_init(void)
48 +static void __init armada_370_xp_timer_init(struct device_node *np)
49  {
50         u32 u;
51 -       struct device_node *np;
52         int res;
53  
54 -       np = of_find_compatible_node(NULL, NULL, "marvell,armada-370-xp-timer");
55         timer_base = of_iomap(np, 0);
56         WARN_ON(!timer_base);
57         local_base = of_iomap(np, 1);
58 @@ -299,3 +297,5 @@ void __init armada_370_xp_timer_init(voi
59  #endif
60         }
61  }
62 +CLOCKSOURCE_OF_DECLARE(armada_370_xp, "marvell,armada-370-xp-timer",
63 +                      armada_370_xp_timer_init);
64 --- a/include/linux/time-armada-370-xp.h
65 +++ /dev/null
66 @@ -1,18 +0,0 @@
67 -/*
68 - * Marvell Armada 370/XP SoC timer handling.
69 - *
70 - * Copyright (C) 2012 Marvell
71 - *
72 - * Lior Amsalem <alior@marvell.com>
73 - * Gregory CLEMENT <gregory.clement@free-electrons.com>
74 - * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
75 - *
76 - */
77 -#ifndef __TIME_ARMADA_370_XPPRCMU_H
78 -#define __TIME_ARMADA_370_XPPRCMU_H
79 -
80 -#include <linux/init.h>
81 -
82 -void __init armada_370_xp_timer_init(void);
83 -
84 -#endif