OSDN Git Service

ARC: [plat*] move code out of .init_machine into common
authorVineet Gupta <vgupta@synopsys.com>
Wed, 10 Sep 2014 05:40:54 +0000 (11:10 +0530)
committerVineet Gupta <vgupta@synopsys.com>
Mon, 13 Oct 2014 09:16:13 +0000 (14:46 +0530)
All the platforms do the same thing in init_machine callback so move it
out of callback into caller of callback

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
arch/arc/Kconfig
arch/arc/kernel/setup.c
arch/arc/plat-arcfpga/platform.c
arch/arc/plat-tb10x/Kconfig
arch/arc/plat-tb10x/tb10x.c

index 9596b0a..bf1e410 100644 (file)
@@ -9,6 +9,7 @@
 config ARC
        def_bool y
        select BUILDTIME_EXTABLE_SORT
+       select COMMON_CLK
        select CLONE_BACKWARDS
        # ARC Busybox based initramfs absolutely relies on DEVTMPFS for /dev
        select DEVTMPFS if !INITRAMFS_SOURCE=""
index da61f22..686e3fa 100644 (file)
@@ -13,7 +13,9 @@
 #include <linux/console.h>
 #include <linux/module.h>
 #include <linux/cpu.h>
+#include <linux/clk-provider.h>
 #include <linux/of_fdt.h>
+#include <linux/of_platform.h>
 #include <linux/cache.h>
 #include <asm/sections.h>
 #include <asm/arcregs.h>
@@ -379,7 +381,13 @@ void __init setup_arch(char **cmdline_p)
 
 static int __init customize_machine(void)
 {
-       /* Add platform devices */
+       of_clk_init(NULL);
+       /*
+        * Traverses flattened DeviceTree - registering platform devices
+        * (if any) complete with their resources
+        */
+       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+
        if (machine_desc->init_machine)
                machine_desc->init_machine();
 
index 57bd24f..b23d5fc 100644 (file)
@@ -14,7 +14,6 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/console.h>
-#include <linux/of_platform.h>
 #include <asm/setup.h>
 #include <asm/clk.h>
 #include <asm/mach_desc.h>
@@ -31,15 +30,6 @@ static void __init plat_fpga_early_init(void)
 #endif
 }
 
-static void __init plat_fpga_populate_dev(void)
-{
-       /*
-        * Traverses flattened DeviceTree - registering platform devices
-        * (if any) complete with their resources
-        */
-       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
-}
-
 /*----------------------- Machine Descriptions ------------------------------
  *
  * Machine description is simply a set of platform/board specific callbacks
@@ -57,7 +47,6 @@ static const char *legacy_fpga_compat[] __initconst = {
 MACHINE_START(LEGACY_FPGA, "legacy_fpga")
        .dt_compat      = legacy_fpga_compat,
        .init_early     = plat_fpga_early_init,
-       .init_machine   = plat_fpga_populate_dev,
 #ifdef CONFIG_ISS_SMP_EXTN
        .init_smp       = iss_model_init_smp,
 #endif
@@ -71,5 +60,4 @@ static const char *simulation_compat[] __initconst = {
 
 MACHINE_START(SIMULATION, "simulation")
        .dt_compat      = simulation_compat,
-       .init_machine   = plat_fpga_populate_dev,
 MACHINE_END
index 6994c18..d14b3d3 100644 (file)
@@ -18,7 +18,6 @@
 
 menuconfig ARC_PLAT_TB10X
        bool "Abilis TB10x"
-       select COMMON_CLK
        select PINCTRL
        select PINCTRL_TB10X
        select PINMUX
index 06cb309..da0ac09 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-
 #include <linux/init.h>
-#include <linux/of_platform.h>
-#include <linux/clk-provider.h>
-#include <linux/pinctrl/consumer.h>
-
 #include <asm/mach_desc.h>
 
-
-static void __init tb10x_platform_init(void)
-{
-       of_clk_init(NULL);
-       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
-}
-
 static const char *tb10x_compat[] __initdata = {
        "abilis,arc-tb10x",
        NULL,
@@ -41,5 +29,4 @@ static const char *tb10x_compat[] __initdata = {
 
 MACHINE_START(TB10x, "tb10x")
        .dt_compat      = tb10x_compat,
-       .init_machine   = tb10x_platform_init,
 MACHINE_END