Partial Revert "Revert "clocksource: pass DT node pointer to init functions""
Dan Willemsen [Thu, 22 Aug 2013 21:15:36 +0000 (14:15 -0700)]
This reverts commit 58f23560b5f0bfe4801c76a7f6b0908d87edfc2c.

Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com>

drivers/clocksource/bcm2835_timer.c
drivers/clocksource/clksrc-of.c
drivers/clocksource/vt8500_timer.c
include/linux/clocksource.h

index 50c68fe..766611d 100644 (file)
@@ -95,23 +95,13 @@ static irqreturn_t bcm2835_time_interrupt(int irq, void *dev_id)
        }
 }
 
-static struct of_device_id bcm2835_time_match[] __initconst = {
-       { .compatible = "brcm,bcm2835-system-timer" },
-       {}
-};
-
-static void __init bcm2835_timer_init(void)
+static void __init bcm2835_timer_init(struct device_node *node)
 {
-       struct device_node *node;
        void __iomem *base;
        u32 freq;
        int irq;
        struct bcm2835_timer *timer;
 
-       node = of_find_matching_node(NULL, bcm2835_time_match);
-       if (!node)
-               panic("No bcm2835 timer node");
-
        base = of_iomap(node, 0);
        if (!base)
                panic("Can't remap registers");
index 560d653..37f5325 100644 (file)
@@ -31,6 +31,6 @@ void __init clocksource_of_init(void)
 
        for_each_matching_node_and_match(np, __clksrc_of_table, &match) {
                init_func = match->data;
-               init_func();
+               init_func(np);
        }
 }
index a07afdc..64f553f 100644 (file)
@@ -129,22 +129,10 @@ static struct irqaction irq = {
        .dev_id  = &clockevent,
 };
 
-static struct of_device_id vt8500_timer_ids[] = {
-       { .compatible = "via,vt8500-timer" },
-       { }
-};
-
-static void __init vt8500_timer_init(void)
+static void __init vt8500_timer_init(struct device_node *np)
 {
-       struct device_node *np;
        int timer_irq;
 
-       np = of_find_matching_node(NULL, vt8500_timer_ids);
-       if (!np) {
-               pr_err("%s: Timer description missing from Device Tree\n",
-                                                               __func__);
-               return;
-       }
        regbase = of_iomap(np, 0);
        if (!regbase) {
                pr_err("%s: Missing iobase description in Device Tree\n",
index f682755..7279b94 100644 (file)
@@ -333,7 +333,8 @@ extern int clocksource_mmio_init(void __iomem *, const char *,
 
 extern int clocksource_i8253_init(void);
 
-typedef void(*clocksource_of_init_fn)();
+struct device_node;
+typedef void(*clocksource_of_init_fn)(struct device_node *);
 #ifdef CONFIG_CLKSRC_OF
 extern void clocksource_of_init(void);