MIPS: Explicitly include correct DT includes
Commit Message
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
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.
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
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
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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"
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -5,7 +5,6 @@
*/
#include <linux/init.h>
#include <linux/io.h>
-#include <linux/of_platform.h>
#include <asm/mach-pic32/pic32.h>
@@ -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>
@@ -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>
@@ -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>