2018-06-19 21:48:47

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH 0/5] 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(-)

--
2.17.1



2018-06-19 21:49:15

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH 4/5] MIPS: generic: remove unnecessary of_platform_populate call

The 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.

Cc: Paul Burton <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: James Hogan <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
arch/mips/generic/init.c | 13 -------------
1 file changed, 13 deletions(-)

diff --git a/arch/mips/generic/init.c b/arch/mips/generic/init.c
index 5ba6fcc26fa7..07ec08462d70 100644
--- a/arch/mips/generic/init.c
+++ b/arch/mips/generic/init.c
@@ -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)
{
}
--
2.17.1


2018-06-19 21:49:18

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH 2/5] MIPS: netlogic: remove unnecessary of_platform_bus_probe call

The 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.

Cc: Ralf Baechle <[email protected]>
Cc: Paul Burton <[email protected]>
Cc: James Hogan <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
arch/mips/netlogic/xlp/dt.c | 14 --------------
1 file changed, 14 deletions(-)

diff --git a/arch/mips/netlogic/xlp/dt.c b/arch/mips/netlogic/xlp/dt.c
index 856a6e6d296e..b5ba83f4c646 100644
--- a/arch/mips/netlogic/xlp/dt.c
+++ b/arch/mips/netlogic/xlp/dt.c
@@ -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);
--
2.17.1


2018-06-19 21:49:44

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH 3/5] MIPS: bmips: remove unnecessary call to register "simple-bus"

The 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.

Cc: Kevin Cernekee <[email protected]>
Cc: Florian Fainelli <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Paul Burton <[email protected]>
Cc: James Hogan <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
arch/mips/bmips/setup.c | 7 -------
1 file changed, 7 deletions(-)

diff --git a/arch/mips/bmips/setup.c b/arch/mips/bmips/setup.c
index 3b6f687f177c..231fc5ce375e 100644
--- a/arch/mips/bmips/setup.c
+++ b/arch/mips/bmips/setup.c
@@ -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);
--
2.17.1


2018-06-19 21:50:35

by Rob Herring (Arm)

[permalink] [raw]
Subject: [PATCH 5/5] MIPS: lantiq: remove unnecessary of_platform_default_populate call

The 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.

Cc: John Crispin <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Paul Burton <[email protected]>
Cc: James Hogan <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
arch/mips/lantiq/prom.c | 8 --------
1 file changed, 8 deletions(-)

diff --git a/arch/mips/lantiq/prom.c b/arch/mips/lantiq/prom.c
index 9ff7ccde9de0..d984bd5c2ec5 100644
--- a/arch/mips/lantiq/prom.c
+++ b/arch/mips/lantiq/prom.c
@@ -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);
--
2.17.1


2018-06-19 21:50:56

by Rob Herring (Arm)

[permalink] [raw]
Subject: [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.

Cc: Ralf Baechle <[email protected]>
Cc: Paul Burton <[email protected]>
Cc: James Hogan <[email protected]>
Cc: [email protected]
Signed-off-by: Rob Herring <[email protected]>
---
arch/mips/cavium-octeon/octeon-platform.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/cavium-octeon/octeon-platform.c b/arch/mips/cavium-octeon/octeon-platform.c
index 8505db478904..2940e9cc3a04 100644
--- a/arch/mips/cavium-octeon/octeon-platform.c
+++ b/arch/mips/cavium-octeon/octeon-platform.c
@@ -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);
--
2.17.1


2018-06-20 17:15:21

by Paul Burton

[permalink] [raw]
Subject: Re: [PATCH 0/5] MIPS: Clean-up DT bus probing

Hi Rob,

On Tue, Jun 19, 2018 at 03:47:05PM -0600, Rob Herring wrote:
> 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(-)

Thanks - series applied to mips-next for 4.19.

Paul