MIPS: Explicitly include correct DT includes

Message ID 20230714174028.4040093-1-robh@kernel.org
State New
Headers
Series MIPS: Explicitly include correct DT includes |

Commit Message

Rob Herring July 14, 2023, 5:40 p.m. UTC
  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(-)
  

Comments

Thomas Bogendoerfer July 25, 2023, 8:48 a.m. UTC | #1
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.
  
Geert Uytterhoeven July 26, 2023, 6:15 p.m. UTC | #2
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
  
Rob Herring July 26, 2023, 8:09 p.m. UTC | #3
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
  

Patch

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>