xtensa: Partially Revert "xtensa: Remove unnecessary of_platform_populate with defaul...
authorRob Herring <robh@kernel.org>
Tue, 26 Jul 2016 16:46:30 +0000 (11:46 -0500)
committerRob Herring <robh@kernel.org>
Tue, 26 Jul 2016 20:04:01 +0000 (15:04 -0500)
This partially reverts commit 69d99e6c0d62 keeping only the main
purpose of the original commit which is the removal of
of_platform_populate() call. The moving of of_clk_init() caused changes
in the initialization order breaking booting.

Fixes: 69d99e6c0d621f ("xtensa: Remove unnecessary of_platform_populate with default match table")
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Tested-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Rob Herring <robh@kernel.org>
arch/xtensa/kernel/setup.c
arch/xtensa/kernel/time.c

index 6f68c6045a70ff56ac6500446eb57e9611609b25..143251ede89784792258469e610e4eb6b0dc6546 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/bootmem.h>
 #include <linux/kernel.h>
 #include <linux/percpu.h>
+#include <linux/clk-provider.h>
 #include <linux/cpu.h>
 #include <linux/of.h>
 #include <linux/of_fdt.h>
@@ -251,6 +252,14 @@ void __init early_init_devtree(void *params)
                strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
 }
 
+static int __init xtensa_device_probe(void)
+{
+       of_clk_init(NULL);
+       return 0;
+}
+
+device_initcall(xtensa_device_probe);
+
 #endif /* CONFIG_OF */
 
 /*
index 6ec73c9f415d1c7d906ec3f00f34c853c2ceb7a5..b9ad9feadc2d1a01da539d69fa735ebb61f607f2 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/time.h>
-#include <linux/clk-provider.h>
 #include <linux/clocksource.h>
 #include <linux/clockchips.h>
 #include <linux/interrupt.h>
@@ -149,7 +148,6 @@ void __init time_init(void)
        local_timer_setup(0);
        setup_irq(this_cpu_ptr(&ccount_timer)->evt.irq, &timer_irqaction);
        sched_clock_register(ccount_sched_clock_read, 32, ccount_freq);
-       of_clk_init(NULL);
        clocksource_probe();
 }