linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] MIPS: Clean-up DT bus probing
@ 2018-06-19 21:47 Rob Herring
  2018-06-19 21:47 ` [PATCH 1/5] MIPS: octeon: use of_platform_populate to probe devices Rob Herring
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Rob Herring @ 2018-06-19 21:47 UTC (permalink / raw)
  To: Ralf Baechle, Paul Burton, James Hogan; +Cc: linux-kernel, linux-mips

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/5] MIPS: octeon: use of_platform_populate to probe devices
  2018-06-19 21:47 [PATCH 0/5] MIPS: Clean-up DT bus probing Rob Herring
@ 2018-06-19 21:47 ` Rob Herring
  2018-06-19 21:47 ` [PATCH 2/5] MIPS: netlogic: remove unnecessary of_platform_bus_probe call Rob Herring
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Rob Herring @ 2018-06-19 21:47 UTC (permalink / raw)
  To: Ralf Baechle, Paul Burton, James Hogan; +Cc: linux-kernel, linux-mips

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 <ralf@linux-mips.org>
Cc: Paul Burton <paul.burton@mips.com>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@linux-mips.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/5] MIPS: netlogic: remove unnecessary of_platform_bus_probe call
  2018-06-19 21:47 [PATCH 0/5] MIPS: Clean-up DT bus probing Rob Herring
  2018-06-19 21:47 ` [PATCH 1/5] MIPS: octeon: use of_platform_populate to probe devices Rob Herring
@ 2018-06-19 21:47 ` Rob Herring
  2018-06-19 21:47 ` [PATCH 3/5] MIPS: bmips: remove unnecessary call to register "simple-bus" Rob Herring
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Rob Herring @ 2018-06-19 21:47 UTC (permalink / raw)
  To: Ralf Baechle, Paul Burton, James Hogan; +Cc: linux-kernel, linux-mips

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 <ralf@linux-mips.org>
Cc: Paul Burton <paul.burton@mips.com>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@linux-mips.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/5] MIPS: bmips: remove unnecessary call to register "simple-bus"
  2018-06-19 21:47 [PATCH 0/5] MIPS: Clean-up DT bus probing Rob Herring
  2018-06-19 21:47 ` [PATCH 1/5] MIPS: octeon: use of_platform_populate to probe devices Rob Herring
  2018-06-19 21:47 ` [PATCH 2/5] MIPS: netlogic: remove unnecessary of_platform_bus_probe call Rob Herring
@ 2018-06-19 21:47 ` Rob Herring
  2018-06-19 21:47 ` [PATCH 4/5] MIPS: generic: remove unnecessary of_platform_populate call Rob Herring
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Rob Herring @ 2018-06-19 21:47 UTC (permalink / raw)
  To: Ralf Baechle, Paul Burton, James Hogan
  Cc: linux-kernel, linux-mips, Kevin Cernekee, Florian Fainelli

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 <cernekee@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Burton <paul.burton@mips.com>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@linux-mips.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/5] MIPS: generic: remove unnecessary of_platform_populate call
  2018-06-19 21:47 [PATCH 0/5] MIPS: Clean-up DT bus probing Rob Herring
                   ` (2 preceding siblings ...)
  2018-06-19 21:47 ` [PATCH 3/5] MIPS: bmips: remove unnecessary call to register "simple-bus" Rob Herring
@ 2018-06-19 21:47 ` Rob Herring
  2018-06-19 21:47 ` [PATCH 5/5] MIPS: lantiq: remove unnecessary of_platform_default_populate call Rob Herring
  2018-06-20 17:14 ` [PATCH 0/5] MIPS: Clean-up DT bus probing Paul Burton
  5 siblings, 0 replies; 7+ messages in thread
From: Rob Herring @ 2018-06-19 21:47 UTC (permalink / raw)
  To: Ralf Baechle, Paul Burton, James Hogan; +Cc: linux-kernel, linux-mips

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 <paul.burton@mips.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@linux-mips.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 5/5] MIPS: lantiq: remove unnecessary of_platform_default_populate call
  2018-06-19 21:47 [PATCH 0/5] MIPS: Clean-up DT bus probing Rob Herring
                   ` (3 preceding siblings ...)
  2018-06-19 21:47 ` [PATCH 4/5] MIPS: generic: remove unnecessary of_platform_populate call Rob Herring
@ 2018-06-19 21:47 ` Rob Herring
  2018-06-20 17:14 ` [PATCH 0/5] MIPS: Clean-up DT bus probing Paul Burton
  5 siblings, 0 replies; 7+ messages in thread
From: Rob Herring @ 2018-06-19 21:47 UTC (permalink / raw)
  To: Ralf Baechle, Paul Burton, James Hogan
  Cc: linux-kernel, linux-mips, John Crispin

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 <john@phrozen.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Burton <paul.burton@mips.com>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@linux-mips.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/5] MIPS: Clean-up DT bus probing
  2018-06-19 21:47 [PATCH 0/5] MIPS: Clean-up DT bus probing Rob Herring
                   ` (4 preceding siblings ...)
  2018-06-19 21:47 ` [PATCH 5/5] MIPS: lantiq: remove unnecessary of_platform_default_populate call Rob Herring
@ 2018-06-20 17:14 ` Paul Burton
  5 siblings, 0 replies; 7+ messages in thread
From: Paul Burton @ 2018-06-20 17:14 UTC (permalink / raw)
  To: Rob Herring; +Cc: Ralf Baechle, James Hogan, linux-kernel, linux-mips

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-06-20 17:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-19 21:47 [PATCH 0/5] MIPS: Clean-up DT bus probing Rob Herring
2018-06-19 21:47 ` [PATCH 1/5] MIPS: octeon: use of_platform_populate to probe devices Rob Herring
2018-06-19 21:47 ` [PATCH 2/5] MIPS: netlogic: remove unnecessary of_platform_bus_probe call Rob Herring
2018-06-19 21:47 ` [PATCH 3/5] MIPS: bmips: remove unnecessary call to register "simple-bus" Rob Herring
2018-06-19 21:47 ` [PATCH 4/5] MIPS: generic: remove unnecessary of_platform_populate call Rob Herring
2018-06-19 21:47 ` [PATCH 5/5] MIPS: lantiq: remove unnecessary of_platform_default_populate call Rob Herring
2018-06-20 17:14 ` [PATCH 0/5] MIPS: Clean-up DT bus probing Paul Burton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).