Commit d7f8a085d4f48501b1fa253b48ec4ad7cb4d02cc
1 parent
70e956483e
Exists in
ti-lsk-linux-4.1.y
and in
10 other branches
ARC: [plat*] move code out of .init_machine into common
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>
Showing 5 changed files with 10 additions and 27 deletions Side-by-side Diff
arch/arc/Kconfig
arch/arc/kernel/setup.c
... | ... | @@ -13,7 +13,9 @@ |
13 | 13 | #include <linux/console.h> |
14 | 14 | #include <linux/module.h> |
15 | 15 | #include <linux/cpu.h> |
16 | +#include <linux/clk-provider.h> | |
16 | 17 | #include <linux/of_fdt.h> |
18 | +#include <linux/of_platform.h> | |
17 | 19 | #include <linux/cache.h> |
18 | 20 | #include <asm/sections.h> |
19 | 21 | #include <asm/arcregs.h> |
... | ... | @@ -379,7 +381,13 @@ |
379 | 381 | |
380 | 382 | static int __init customize_machine(void) |
381 | 383 | { |
382 | - /* Add platform devices */ | |
384 | + of_clk_init(NULL); | |
385 | + /* | |
386 | + * Traverses flattened DeviceTree - registering platform devices | |
387 | + * (if any) complete with their resources | |
388 | + */ | |
389 | + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | |
390 | + | |
383 | 391 | if (machine_desc->init_machine) |
384 | 392 | machine_desc->init_machine(); |
385 | 393 |
arch/arc/plat-arcfpga/platform.c
... | ... | @@ -14,7 +14,6 @@ |
14 | 14 | #include <linux/platform_device.h> |
15 | 15 | #include <linux/io.h> |
16 | 16 | #include <linux/console.h> |
17 | -#include <linux/of_platform.h> | |
18 | 17 | #include <asm/setup.h> |
19 | 18 | #include <asm/clk.h> |
20 | 19 | #include <asm/mach_desc.h> |
... | ... | @@ -31,15 +30,6 @@ |
31 | 30 | #endif |
32 | 31 | } |
33 | 32 | |
34 | -static void __init plat_fpga_populate_dev(void) | |
35 | -{ | |
36 | - /* | |
37 | - * Traverses flattened DeviceTree - registering platform devices | |
38 | - * (if any) complete with their resources | |
39 | - */ | |
40 | - of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | |
41 | -} | |
42 | - | |
43 | 33 | /*----------------------- Machine Descriptions ------------------------------ |
44 | 34 | * |
45 | 35 | * Machine description is simply a set of platform/board specific callbacks |
... | ... | @@ -57,7 +47,6 @@ |
57 | 47 | MACHINE_START(LEGACY_FPGA, "legacy_fpga") |
58 | 48 | .dt_compat = legacy_fpga_compat, |
59 | 49 | .init_early = plat_fpga_early_init, |
60 | - .init_machine = plat_fpga_populate_dev, | |
61 | 50 | #ifdef CONFIG_ISS_SMP_EXTN |
62 | 51 | .init_smp = iss_model_init_smp, |
63 | 52 | #endif |
... | ... | @@ -71,6 +60,5 @@ |
71 | 60 | |
72 | 61 | MACHINE_START(SIMULATION, "simulation") |
73 | 62 | .dt_compat = simulation_compat, |
74 | - .init_machine = plat_fpga_populate_dev, | |
75 | 63 | MACHINE_END |
arch/arc/plat-tb10x/Kconfig
arch/arc/plat-tb10x/tb10x.c
... | ... | @@ -19,21 +19,9 @@ |
19 | 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
20 | 20 | */ |
21 | 21 | |
22 | - | |
23 | 22 | #include <linux/init.h> |
24 | -#include <linux/of_platform.h> | |
25 | -#include <linux/clk-provider.h> | |
26 | -#include <linux/pinctrl/consumer.h> | |
27 | - | |
28 | 23 | #include <asm/mach_desc.h> |
29 | 24 | |
30 | - | |
31 | -static void __init tb10x_platform_init(void) | |
32 | -{ | |
33 | - of_clk_init(NULL); | |
34 | - of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | |
35 | -} | |
36 | - | |
37 | 25 | static const char *tb10x_compat[] __initdata = { |
38 | 26 | "abilis,arc-tb10x", |
39 | 27 | NULL, |
... | ... | @@ -41,6 +29,5 @@ |
41 | 29 | |
42 | 30 | MACHINE_START(TB10x, "tb10x") |
43 | 31 | .dt_compat = tb10x_compat, |
44 | - .init_machine = tb10x_platform_init, | |
45 | 32 | MACHINE_END |