devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MIPS: Explicitly include correct DT includes
@ 2023-07-14 17:40 Rob Herring
  2023-07-25  8:48 ` Thomas Bogendoerfer
  2023-07-26 18:15 ` Geert Uytterhoeven
  0 siblings, 2 replies; 4+ messages in thread
From: Rob Herring @ 2023-07-14 17:40 UTC (permalink / raw)
  To: Florian Fainelli, Broadcom internal kernel review list,
	Thomas Bogendoerfer, John Crispin
  Cc: devicetree, linux-mips, linux-kernel

The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring <robh@kernel.org>
---
 arch/mips/bmips/setup.c               | 1 -
 arch/mips/cavium-octeon/flash_setup.c | 3 ++-
 arch/mips/lantiq/irq.c                | 2 +-
 arch/mips/lantiq/xway/dcdc.c          | 3 ++-
 arch/mips/lantiq/xway/gptu.c          | 4 ++--
 arch/mips/lantiq/xway/sysctrl.c       | 1 -
 arch/mips/lantiq/xway/vmmc.c          | 3 ++-
 arch/mips/pci/pci-lantiq.c            | 4 ++--
 arch/mips/pci/pci-rt2880.c            | 5 ++---
 arch/mips/pic32/pic32mzda/config.c    | 1 -
 arch/mips/ralink/irq.c                | 2 +-
 arch/mips/ralink/of.c                 | 2 +-
 arch/mips/ralink/prom.c               | 2 --
 13 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/arch/mips/bmips/setup.c b/arch/mips/bmips/setup.c
index 053805cb741c..ec180ab92eaa 100644
--- a/arch/mips/bmips/setup.c
+++ b/arch/mips/bmips/setup.c
@@ -16,7 +16,6 @@
 #include <linux/of.h>
 #include <linux/of_clk.h>
 #include <linux/of_fdt.h>
-#include <linux/of_platform.h>
 #include <linux/libfdt.h>
 #include <linux/smp.h>
 #include <asm/addrspace.h>
diff --git a/arch/mips/cavium-octeon/flash_setup.c b/arch/mips/cavium-octeon/flash_setup.c
index c8a8c6d359b9..3395acde4d60 100644
--- a/arch/mips/cavium-octeon/flash_setup.c
+++ b/arch/mips/cavium-octeon/flash_setup.c
@@ -12,7 +12,8 @@
 #include <linux/semaphore.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/map.h>
-#include <linux/of_platform.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
 #include <linux/mtd/partitions.h>
 
 #include <asm/octeon/octeon.h>
diff --git a/arch/mips/lantiq/irq.c b/arch/mips/lantiq/irq.c
index 20622bf0a9b3..8f208007b8e8 100644
--- a/arch/mips/lantiq/irq.c
+++ b/arch/mips/lantiq/irq.c
@@ -10,7 +10,7 @@
 #include <linux/sched.h>
 #include <linux/irqchip.h>
 #include <linux/irqdomain.h>
-#include <linux/of_platform.h>
+#include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
 
diff --git a/arch/mips/lantiq/xway/dcdc.c b/arch/mips/lantiq/xway/dcdc.c
index 96199966a350..4a808f8c5beb 100644
--- a/arch/mips/lantiq/xway/dcdc.c
+++ b/arch/mips/lantiq/xway/dcdc.c
@@ -6,7 +6,8 @@
  */
 
 #include <linux/ioport.h>
-#include <linux/of_platform.h>
+#include <linux/mod_devicetable.h>
+#include <linux/platform_device.h>
 
 #include <lantiq_soc.h>
 
diff --git a/arch/mips/lantiq/xway/gptu.c b/arch/mips/lantiq/xway/gptu.c
index a492b1eb1925..e254b108fb9b 100644
--- a/arch/mips/lantiq/xway/gptu.c
+++ b/arch/mips/lantiq/xway/gptu.c
@@ -8,8 +8,8 @@
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
 #include <linux/init.h>
-#include <linux/of_platform.h>
-#include <linux/of_irq.h>
+#include <linux/mod_devicetable.h>
+#include <linux/platform_device.h>
 
 #include <lantiq_soc.h>
 #include "../clk.h"
diff --git a/arch/mips/lantiq/xway/sysctrl.c b/arch/mips/lantiq/xway/sysctrl.c
index d444a1b98a72..3ed078225222 100644
--- a/arch/mips/lantiq/xway/sysctrl.c
+++ b/arch/mips/lantiq/xway/sysctrl.c
@@ -10,7 +10,6 @@
 #include <linux/clkdev.h>
 #include <linux/spinlock.h>
 #include <linux/of.h>
-#include <linux/of_platform.h>
 #include <linux/of_address.h>
 
 #include <lantiq_soc.h>
diff --git a/arch/mips/lantiq/xway/vmmc.c b/arch/mips/lantiq/xway/vmmc.c
index 2796e87dfcae..37c133052ef7 100644
--- a/arch/mips/lantiq/xway/vmmc.c
+++ b/arch/mips/lantiq/xway/vmmc.c
@@ -7,7 +7,8 @@
 #include <linux/err.h>
 #include <linux/export.h>
 #include <linux/gpio/consumer.h>
-#include <linux/of_platform.h>
+#include <linux/mod_devicetable.h>
+#include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
 
 #include <lantiq_soc.h>
diff --git a/arch/mips/pci/pci-lantiq.c b/arch/mips/pci/pci-lantiq.c
index 79e29bf42a24..80f7293166bb 100644
--- a/arch/mips/pci/pci-lantiq.c
+++ b/arch/mips/pci/pci-lantiq.c
@@ -13,9 +13,9 @@
 #include <linux/mm.h>
 #include <linux/vmalloc.h>
 #include <linux/clk.h>
-#include <linux/of_platform.h>
-#include <linux/of_irq.h>
+#include <linux/of.h>
 #include <linux/of_pci.h>
+#include <linux/platform_device.h>
 
 #include <asm/addrspace.h>
 
diff --git a/arch/mips/pci/pci-rt2880.c b/arch/mips/pci/pci-rt2880.c
index e9dd01431f21..1cada09fa5db 100644
--- a/arch/mips/pci/pci-rt2880.c
+++ b/arch/mips/pci/pci-rt2880.c
@@ -13,9 +13,8 @@
 #include <linux/pci.h>
 #include <linux/io.h>
 #include <linux/init.h>
-#include <linux/of_platform.h>
-#include <linux/of_irq.h>
-#include <linux/of_pci.h>
+#include <linux/mod_devicetable.h>
+#include <linux/platform_device.h>
 
 #include <asm/mach-ralink/rt288x.h>
 
diff --git a/arch/mips/pic32/pic32mzda/config.c b/arch/mips/pic32/pic32mzda/config.c
index f69532007717..6e94ae66eba8 100644
--- a/arch/mips/pic32/pic32mzda/config.c
+++ b/arch/mips/pic32/pic32mzda/config.c
@@ -5,7 +5,6 @@
  */
 #include <linux/init.h>
 #include <linux/io.h>
-#include <linux/of_platform.h>
 
 #include <asm/mach-pic32/pic32.h>
 
diff --git a/arch/mips/ralink/irq.c b/arch/mips/ralink/irq.c
index fa353bc13947..46aef0a1b22a 100644
--- a/arch/mips/ralink/irq.c
+++ b/arch/mips/ralink/irq.c
@@ -7,7 +7,7 @@
 
 #include <linux/io.h>
 #include <linux/bitops.h>
-#include <linux/of_platform.h>
+#include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
 #include <linux/irqdomain.h>
diff --git a/arch/mips/ralink/of.c b/arch/mips/ralink/of.c
index 45d60c094496..7f90068c68f2 100644
--- a/arch/mips/ralink/of.c
+++ b/arch/mips/ralink/of.c
@@ -14,7 +14,7 @@
 #include <linux/of_fdt.h>
 #include <linux/kernel.h>
 #include <linux/memblock.h>
-#include <linux/of_platform.h>
+#include <linux/of.h>
 #include <linux/of_address.h>
 
 #include <asm/reboot.h>
diff --git a/arch/mips/ralink/prom.c b/arch/mips/ralink/prom.c
index aaac1e6ec7d9..c3b96861844c 100644
--- a/arch/mips/ralink/prom.c
+++ b/arch/mips/ralink/prom.c
@@ -7,8 +7,6 @@
  */
 
 #include <linux/string.h>
-#include <linux/of_fdt.h>
-#include <linux/of_platform.h>
 
 #include <asm/bootinfo.h>
 #include <asm/addrspace.h>
-- 
2.40.1


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

* Re: [PATCH] MIPS: Explicitly include correct DT includes
  2023-07-14 17:40 [PATCH] MIPS: Explicitly include correct DT includes Rob Herring
@ 2023-07-25  8:48 ` Thomas Bogendoerfer
  2023-07-26 18:15 ` Geert Uytterhoeven
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Bogendoerfer @ 2023-07-25  8:48 UTC (permalink / raw)
  To: Rob Herring
  Cc: Florian Fainelli, Broadcom internal kernel review list,
	John Crispin, devicetree, linux-mips, linux-kernel

On Fri, Jul 14, 2023 at 11:40:27AM -0600, Rob Herring wrote:
> The DT of_device.h and of_platform.h date back to the separate
> of_platform_bus_type before it as merged into the regular platform bus.
> As part of that merge prepping Arm DT support 13 years ago, they
> "temporarily" include each other. They also include platform_device.h
> and of.h. As a result, there's a pretty much random mix of those include
> files used throughout the tree. In order to detangle these headers and
> replace the implicit includes with struct declarations, users need to
> explicitly include the correct includes.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  arch/mips/bmips/setup.c               | 1 -
>  arch/mips/cavium-octeon/flash_setup.c | 3 ++-
>  arch/mips/lantiq/irq.c                | 2 +-
>  arch/mips/lantiq/xway/dcdc.c          | 3 ++-
>  arch/mips/lantiq/xway/gptu.c          | 4 ++--
>  arch/mips/lantiq/xway/sysctrl.c       | 1 -
>  arch/mips/lantiq/xway/vmmc.c          | 3 ++-
>  arch/mips/pci/pci-lantiq.c            | 4 ++--
>  arch/mips/pci/pci-rt2880.c            | 5 ++---
>  arch/mips/pic32/pic32mzda/config.c    | 1 -
>  arch/mips/ralink/irq.c                | 2 +-
>  arch/mips/ralink/of.c                 | 2 +-
>  arch/mips/ralink/prom.c               | 2 --
>  13 files changed, 15 insertions(+), 18 deletions(-)

applied to mips-next.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

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

* Re: [PATCH] MIPS: Explicitly include correct DT includes
  2023-07-14 17:40 [PATCH] MIPS: Explicitly include correct DT includes Rob Herring
  2023-07-25  8:48 ` Thomas Bogendoerfer
@ 2023-07-26 18:15 ` Geert Uytterhoeven
  2023-07-26 20:09   ` Rob Herring
  1 sibling, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2023-07-26 18:15 UTC (permalink / raw)
  To: Rob Herring
  Cc: Florian Fainelli, Broadcom internal kernel review list,
	Thomas Bogendoerfer, John Crispin, devicetree, linux-mips,
	linux-kernel

Hi Rob,

On Fri, Jul 14, 2023 at 7:44 PM Rob Herring <robh@kernel.org> wrote:
> The DT of_device.h and of_platform.h date back to the separate
> of_platform_bus_type before it as merged into the regular platform bus.
> As part of that merge prepping Arm DT support 13 years ago, they
> "temporarily" include each other. They also include platform_device.h
> and of.h. As a result, there's a pretty much random mix of those include
> files used throughout the tree. In order to detangle these headers and
> replace the implicit includes with struct declarations, users need to
> explicitly include the correct includes.
>
> Signed-off-by: Rob Herring <robh@kernel.org>

Thanks for your patch, which is now commit 657c45b303f87d77 ("MIPS:
Explicitly include correct DT includes") in next-20230726.

> --- a/arch/mips/lantiq/xway/gptu.c
> +++ b/arch/mips/lantiq/xway/gptu.c
> @@ -8,8 +8,8 @@
>  #include <linux/interrupt.h>
>  #include <linux/ioport.h>
>  #include <linux/init.h>
> -#include <linux/of_platform.h>
> -#include <linux/of_irq.h>

Based on https://lore.kernel.org/all/202307270140.uClzsYnD-lkp@intel.com,
I guess you need to keep of_irq.h for of_irq_to_resource_table()?

> +#include <linux/mod_devicetable.h>
> +#include <linux/platform_device.h>
>
>  #include <lantiq_soc.h>
>  #include "../clk.h"

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH] MIPS: Explicitly include correct DT includes
  2023-07-26 18:15 ` Geert Uytterhoeven
@ 2023-07-26 20:09   ` Rob Herring
  0 siblings, 0 replies; 4+ messages in thread
From: Rob Herring @ 2023-07-26 20:09 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Florian Fainelli, Broadcom internal kernel review list,
	Thomas Bogendoerfer, John Crispin, devicetree, linux-mips,
	linux-kernel

On Wed, Jul 26, 2023 at 12:15 PM Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
>
> Hi Rob,
>
> On Fri, Jul 14, 2023 at 7:44 PM Rob Herring <robh@kernel.org> wrote:
> > The DT of_device.h and of_platform.h date back to the separate
> > of_platform_bus_type before it as merged into the regular platform bus.
> > As part of that merge prepping Arm DT support 13 years ago, they
> > "temporarily" include each other. They also include platform_device.h
> > and of.h. As a result, there's a pretty much random mix of those include
> > files used throughout the tree. In order to detangle these headers and
> > replace the implicit includes with struct declarations, users need to
> > explicitly include the correct includes.
> >
> > Signed-off-by: Rob Herring <robh@kernel.org>
>
> Thanks for your patch, which is now commit 657c45b303f87d77 ("MIPS:
> Explicitly include correct DT includes") in next-20230726.
>
> > --- a/arch/mips/lantiq/xway/gptu.c
> > +++ b/arch/mips/lantiq/xway/gptu.c
> > @@ -8,8 +8,8 @@
> >  #include <linux/interrupt.h>
> >  #include <linux/ioport.h>
> >  #include <linux/init.h>
> > -#include <linux/of_platform.h>
> > -#include <linux/of_irq.h>
>
> Based on https://lore.kernel.org/all/202307270140.uClzsYnD-lkp@intel.com,
> I guess you need to keep of_irq.h for of_irq_to_resource_table()?

Ugg, yes. Posting a fix momentarily.

Too many config combinations to test on some arches...


Rob

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

end of thread, other threads:[~2023-07-26 20:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-14 17:40 [PATCH] MIPS: Explicitly include correct DT includes Rob Herring
2023-07-25  8:48 ` Thomas Bogendoerfer
2023-07-26 18:15 ` Geert Uytterhoeven
2023-07-26 20:09   ` Rob Herring

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