MIPS: Clean-up DT bus probing
cover MIPS: Clean-up DT bus probing
This is a series of clean-ups of DT bus probing calls. Generally, the DT core code takes care of the default case and arches/platforms only need to do their own call if they have non-default matching requirements.
Rob
Rob Herring (5):
MIPS: octeon: use of_platform_populate to probe devices
MIPS: netlogic: remove unnecessary of_platform_bus_probe call
MIPS: bmips: remove unnecessary call to register "simple-bus"
MIPS: generic: remove unnecessary of_platform_populate call
MIPS: lantiq: remove unnecessary of_platform_default_populate call
arch/mips/bmips/setup.c | 7 ------- arch/mips/cavium-octeon/octeon-platform.c | 2 +- arch/mips/generic/init.c | 13 ------------- arch/mips/lantiq/prom.c | 8 -------- arch/mips/netlogic/xlp/dt.c | 14 -------------- 5 files changed, 1 insertion(+), 43 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/5 MIPS: octeon: use of_platform_populate to probe devices
of_platform_bus_probe is deprecated in favor of of_platform_populate. of_platform_populate is stricter requiring compatible properties for matching rather than name or type. Octeon uses compatible strings for matching, so convert it to of_platform_populate.
--- arch/mips/cavium-octeon/octeon-platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/cavium-octeon/octeon-platform.c +1 -1
@@ -1067,6 +1067,6 @@ int __init octeon_prune_device_tree(void)static int __init octeon_publish_devices (void ) { -return of_platform_bus_probe (NULL , octeon_ids,NULL ); +return of_platform_populate (NULL , octeon_ids,NULL ,NULL ); }arch_initcall (octeon_publish_devices);
Signature · 1 line
2.17.1
PATCH 2/5 MIPS: netlogic: remove unnecessary of_platform_bus_probe call
In reply to Rob HerringThe DT core code will probe "simple-bus" by default, so remove the Netlogic specific call. The probing of simple-bus happens at arch_initcall_sync, so the call being removed here is already a nop.
--- arch/mips/netlogic/xlp/dt.c | 14 -------------- 1 file changed, 14 deletions(-)
arch/mips/netlogic/xlp/dt.c +0 -14
@@ -93,17 +93,3 @@ void __init device_tree_init(void) {unflatten_and_copy_device_tree (); } - -static struct of_device_id __initdata xlp_ids[] = { - { .compatible ="simple-bus" , }, - {}, -}; - -int __init xlp8xx_ds_publish_devices (void ) -{ -if (!of_have_populated_dt ()) -return 0 ; -return of_platform_bus_probe (NULL , xlp_ids,NULL ); -} - -device_initcall (xlp8xx_ds_publish_devices);
Signature · 1 line
2.17.1
PATCH 3/5 MIPS: bmips: remove unnecessary call to register "simple-bus"
In reply to Rob HerringThe DT core will register "simple-bus" by default, so it is not necessary for arch specific code to do so unless there are custom match entries, auxdata or parent device. Neither of those apply here, so remove the call.
--- arch/mips/bmips/setup.c | 7 ------- 1 file changed, 7 deletions(-)
arch/mips/bmips/setup.c +0 -7
@@ -202,13 +202,6 @@ void __init device_tree_init(void)of_node_put (np); } -int __init plat_of_setup (void ) -{ -return __dt_register_buses ("simple-bus" ,NULL ); -} - -arch_initcall (plat_of_setup); -static int __init plat_dev_init (void ) {of_clk_init (NULL );
Signature · 1 line
2.17.1
PATCH 4/5 MIPS: generic: remove unnecessary of_platform_populate call
In reply to Rob HerringThe DT core will call of_platform_populate, so it is not necessary for arch specific code to call it unless there are custom match entries, auxdata or parent device. Neither of those apply here, so remove the call.
--- arch/mips/generic/init.c | 13 ------------- 1 file changed, 13 deletions(-)
arch/mips/generic/init.c +0 -13
@@ -14,7 +14,6 @@#include <linux/init.h> #include <linux/irqchip.h> #include <linux/of_fdt.h> -#include <linux/of_platform.h> #include <asm/bootinfo.h> #include <asm/fw/fw.h>
@@ -208,18 +207,6 @@ void __init arch_init_irq(void)irqchip_init (); } -static int __init publish_devices (void ) -{ -if (!of_have_populated_dt ()) -panic ("Device-tree not present" ); - -if (of_platform_populate (NULL , of_default_bus_match_table,NULL ,NULL )) -panic ("Failed to populate DT" ); - -return 0 ; -} -arch_initcall (publish_devices); -void __init prom_free_prom_memory (void ) { }
Signature · 1 line
2.17.1
PATCH 5/5 MIPS: lantiq: remove unnecessary of_platform_default_populate call
In reply to Rob HerringThe DT core will call of_platform_default_populate, so it is not necessary for arch specific code to call it unless there are custom match entries, auxdata or parent device. Neither of those apply here, so remove the call.
--- arch/mips/lantiq/prom.c | 8 -------- 1 file changed, 8 deletions(-)
arch/mips/lantiq/prom.c +0 -8
@@ -9,7 +9,6 @@#include <linux/export.h> #include <linux/clk.h> #include <linux/bootmem.h> -#include <linux/of_platform.h> #include <linux/of_fdt.h> #include <asm/bootinfo.h>
@@ -114,10 +113,3 @@ void __init prom_init(void)panic ("failed to register_vsmp_smp_ops()" );#endif } - -int __init plat_of_setup (void ) -{ -return of_platform_default_populate (NULL ,NULL ,NULL ); -} - -arch_initcall (plat_of_setup);
Signature · 1 line
2.17.1
Hi Rob,
Quoted 14 lines · Rob Herring
This is a series of clean-ups of DT bus probing calls. Generally, the DT core code takes care of the default case and arches/platforms only need to do their own call if they have non-default matching requirements.
Rob
Rob Herring (5):
MIPS: octeon: useof_platform_populateto probe devices
MIPS: netlogic: remove unnecessaryof_platform_bus_probecall
MIPS: bmips: remove unnecessary call to register "simple-bus"
MIPS: generic: remove unnecessaryof_platform_populatecall
MIPS: lantiq: remove unnecessaryof_platform_default_populatecall
Quoted 6 lines
arch/mips/bmips/setup.c | 7 ------- arch/mips/cavium-octeon/octeon-platform.c | 2 +- arch/mips/generic/init.c | 13 ------------- arch/mips/lantiq/prom.c | 8 -------- arch/mips/netlogic/xlp/dt.c | 14 -------------- 5 files changed, 1 insertion(+), 43 deletions(-)
Thanks - series applied to mips-next for 4.19.
Paul