microblaze: timer: Do not initialized system timer twice
authorMichal Simek <michal.simek@xilinx.com>
Mon, 27 Jan 2014 09:41:59 +0000 (10:41 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Mon, 27 Jan 2014 10:26:31 +0000 (11:26 +0100)
Only one system timer can be setup.
Do not initialize more system timers.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arch/microblaze/kernel/timer.c

index 06609e01f1cfbcedc85a407912597e8822a581e7..fb0c61443f196ebbe7776e2d88108280bbc80025 100644 (file)
@@ -230,9 +230,15 @@ static int __init xilinx_clocksource_init(void)
 static void __init xilinx_timer_init(struct device_node *timer)
 {
        struct clk *clk;
+       static int initialized;
        u32 irq;
        u32 timer_num = 1;
 
+       if (initialized)
+               return;
+
+       initialized = 1;
+
        timer_baseaddr = of_iomap(timer, 0);
        if (!timer_baseaddr) {
                pr_err("ERROR: invalid timer base address\n");