Skip to contentSkip to conversation

of: prom.h clean-up and removal

PATCH In review Rob Herring 6 participants 36 messages Sep 26, 2013 – Oct 4, 2013

Subsystems (48)
lore
Share & tools
lore
#0 lore raw

cover of: prom.h clean-up and removal

From: Rob Herring <[email protected]>

This is the second series of clean-up for architecture DT code. The first series is here [1].

As the number of DT enabled architectures has grown, there has been a lot of copy/paste duplication of prom.h. The include ordering for prom.h is complex and has resulted in many implicit includes. This series cleans up prom.h and removes the dependency of prom.h includes in the core DT code on all architectures except sparc. This removes prom.h on several architectures and makes it an architecture specific include on the rest.

Compiled on arm, arm64, microblaze, mips, openrisc, powerpc, sparc, xtensa. Mostly defconfigs and some allyesconfigs. The 0-day builder has also caught some issues.

A branch with both series is available here:
git://sources.calxeda.com/kernel/linux.git dt-cleanup

Rob

[1] http://www.spinics.net/lists/devicetree/msg04865.html

Rob Herring (21):
drivers: remove unnecessary prom.h includes
of: remove unnecessary prom.h includes
ARM: keystone: remove unnecessary prom.h include
arm64: remove unnecessary prom.h include
openrisc: remove unnecessary prom.h include
arc: remove unnecessary prom.h includes
hexagon: remove unnecessary prom.h includes
metag: move setup_machine_fdt declaration from prom.h
microblaze: clean-up prom.h implicit includes
drivers: clean-up prom.h implicit includes
mips: add explicit includes of prom.h
x86: add necessary includes for prom.h
of: implement pci_address_to_pio as weak function
of: implement of_node_to_nid as a weak function
of: remove HAVE_ARCH_DEVTREE_FIXUPS
of: move of_address_to_resource and of_iomap declarations from sparc
of: move of_translate_dma_address to of_address.h
powerpc: clean-up include ordering in prom.h
powerpc: add explicit OF includes
of: only include prom.h on sparc
of: remove empty arch prom.h headers

 arch/arc/include/asm/prom.h                      | 14 ---------
 arch/arc/kernel/devtree.c                        |  1 -
 arch/arc/kernel/setup.c                          |  1 -
 arch/arm/include/asm/prom.h                      |  2 --
 arch/arm/mach-keystone/platsmp.c                 |  1 -
 arch/arm64/include/asm/prom.h                    |  1 -
 arch/arm64/mm/init.c                             |  1 -
 arch/c6x/include/asm/prom.h                      |  1 -
 arch/hexagon/kernel/setup.c                      |  3 --
 arch/metag/include/asm/prom.h                    | 23 --------------
 arch/metag/include/asm/setup.h                   |  1 +
 arch/metag/kernel/setup.c                        |  1 -
 arch/microblaze/include/asm/prom.h               | 39 +-----------------------
 arch/microblaze/kernel/prom.c                    |  1 +
 arch/microblaze/kernel/setup.c                   |  1 +
 arch/microblaze/kernel/timer.c                   |  1 +
 arch/microblaze/pci/pci-common.c                 |  1 +
 arch/mips/include/asm/prom.h                     | 11 -------
 arch/mips/lantiq/prom.c                          |  1 +
 arch/mips/mti-sead3/sead3-setup.c                |  2 ++
 arch/mips/ralink/of.c                            |  1 +
 arch/openrisc/include/asm/prom.h                 | 22 -------------
 arch/openrisc/kernel/prom.c                      |  1 -
 arch/powerpc/include/asm/prom.h                  | 33 ++++----------------
 arch/powerpc/kernel/epapr_paravirt.c             |  1 +
 arch/powerpc/platforms/512x/clock.c              |  1 +
 arch/powerpc/platforms/512x/pdm360ng.c           |  2 ++
 arch/powerpc/platforms/82xx/mpc8272_ads.c        |  2 ++
 arch/powerpc/platforms/82xx/pq2fads.c            |  2 ++
 arch/powerpc/platforms/83xx/suspend.c            |  2 ++
 arch/powerpc/platforms/86xx/pic.c                |  1 +
 arch/powerpc/platforms/embedded6xx/flipper-pic.c |  1 +
 arch/powerpc/platforms/embedded6xx/hlwd-pic.c    |  2 ++
 arch/powerpc/platforms/pasemi/gpio_mdio.c        |  1 +
 arch/powerpc/platforms/powermac/pfunc_base.c     |  1 +
 arch/powerpc/platforms/powernv/opal-lpc.c        |  1 +
 arch/powerpc/platforms/powernv/opal.c            |  1 +
 arch/powerpc/platforms/powernv/setup.c           |  1 +
 arch/powerpc/platforms/pseries/hotplug-memory.c  |  2 ++
 arch/powerpc/sysdev/cpm_common.c                 |  1 +
 arch/powerpc/sysdev/fsl_gtm.c                    |  2 ++
 arch/powerpc/sysdev/fsl_pmc.c                    |  1 +
 arch/powerpc/sysdev/mpic.c                       |  8 ++---
 arch/powerpc/sysdev/mpic_timer.c                 |  2 ++
 arch/sparc/include/asm/prom.h                    | 12 --------
 arch/x86/include/asm/prom.h                      |  5 ---
 arch/x86/kernel/devicetree.c                     | 11 +------
 arch/xtensa/include/asm/prom.h                   |  6 ----
 drivers/ata/sata_fsl.c                           |  2 ++
 drivers/char/bsr.c                               |  1 +
 drivers/char/hw_random/pasemi-rng.c              |  1 +
 drivers/cpufreq/pasemi-cpufreq.c                 |  1 +
 drivers/crypto/caam/ctrl.c                       |  3 ++
 drivers/crypto/caam/jr.c                         |  2 ++
 drivers/dma/fsldma.c                             |  2 ++
 drivers/edac/cell_edac.c                         |  1 +
 drivers/i2c/busses/i2c-mpc.c                     |  2 ++
 drivers/i2c/busses/i2c-powermac.c                |  1 +
 drivers/input/serio/xilinx_ps2.c                 |  1 +
 drivers/macintosh/macio_asic.c                   |  2 ++
 drivers/macintosh/rack-meter.c                   |  2 ++
 drivers/macintosh/smu.c                          |  1 +
 drivers/macintosh/via-pmu.c                      |  2 ++
 drivers/mtd/nand/fsl_elbc_nand.c                 |  1 +
 drivers/mtd/nand/pasemi_nand.c                   |  2 ++
 drivers/net/can/grcan.c                          |  3 --
 drivers/net/can/sja1000/sja1000_of_platform.c    |  1 -
 drivers/net/ethernet/ibm/emac/core.c             |  2 ++
 drivers/net/ethernet/ibm/emac/mal.c              |  1 +
 drivers/net/ethernet/ibm/emac/rgmii.c            |  1 +
 drivers/net/ethernet/ibm/emac/tah.c              |  1 +
 drivers/net/ethernet/ibm/emac/zmii.c             |  1 +
 drivers/net/ethernet/xilinx/ll_temac_main.c      |  1 +
 drivers/of/address.c                             |  8 +++++
 drivers/of/base.c                                |  7 +++++
 drivers/of/of_pci.c                              |  1 -
 drivers/of/of_pci_irq.c                          |  1 -
 drivers/of/pdt.c                                 |  1 -
 drivers/pcmcia/electra_cf.c                      |  2 ++
 drivers/tty/ehv_bytechan.c                       |  1 +
 drivers/tty/serial/pmac_zilog.c                  |  2 ++
 drivers/usb/host/ehci-ppc-of.c                   |  2 ++
 drivers/usb/host/ohci-ppc-of.c                   |  2 ++
 fs/proc/proc_devtree.c                           |  3 --
 include/linux/of.h                               | 13 ++++----
 include/linux/of_address.h                       | 39 +++++++++++++-----------
 sound/aoa/core/gpio-feature.c                    |  3 +-
 sound/aoa/soundbus/i2sbus/core.c                 |  2 ++
 sound/ppc/pmac.c                                 |  2 ++
 sound/ppc/tumbler.c                              |  1 +
 90 files changed, 141 insertions(+), 220 deletions(-)
 delete mode 100644 arch/arc/include/asm/prom.h
 delete mode 100644 arch/arm64/include/asm/prom.h
 delete mode 100644 arch/c6x/include/asm/prom.h
 delete mode 100644 arch/metag/include/asm/prom.h
 delete mode 100644 arch/openrisc/include/asm/prom.h
 delete mode 100644 arch/xtensa/include/asm/prom.h
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 1/21 drivers: remove unnecessary prom.h includes

From: Rob Herring <[email protected]>

Remove unnecessary prom.h includes in preparation to remove implicit includes of prom.h.

---
 drivers/net/can/grcan.c                       | 3 ---
 drivers/net/can/sja1000/sja1000_of_platform.c | 1 -
 2 files changed, 4 deletions(-)
drivers/net/can/grcan.c +0 -3
index 6aa737a..ab506d6 100644
@@ -34,10 +34,7 @@
 #include <linux/io.h>
 #include <linux/can/dev.h>
 #include <linux/spinlock.h>
-
 #include <linux/of_platform.h>
-#include <asm/prom.h>
-
 #include <linux/of_irq.h>
 
 #include <linux/dma-mapping.h>
drivers/net/can/sja1000/sja1000_of_platform.c +0 -1
index 31ad339..047accd 100644
@@ -44,7 +44,6 @@
 #include <linux/of_platform.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
-#include <asm/prom.h>
 
 #include "sja1000.h"
 
Signature · 1 line
1.8.1.2
#5 lore raw

PATCH 2/21 of: remove unnecessary prom.h includes

In reply to Rob Herring

From: Rob Herring <rob.herring-bsGFqQB8/[email protected]>

Remove unnecessary prom.h includes in preparation to make prom.h optional.

---
 drivers/of/of_pci_irq.c | 1 -
 drivers/of/pdt.c        | 1 -
 2 files changed, 2 deletions(-)
drivers/of/of_pci_irq.c +0 -1
index 6770538..d860764 100644
@@ -2,7 +2,6 @@
 #include <linux/of_pci.h>
 #include <linux/of_irq.h>
 #include <linux/export.h>
-#include <asm/prom.h>
 
 /**
  * of_irq_map_pci - Resolve the interrupt for a PCI device
drivers/of/pdt.c +0 -1
index 4ec19cb..7b66673 100644
@@ -22,7 +22,6 @@
 #include <linux/slab.h>
 #include <linux/of.h>
 #include <linux/of_pdt.h>
-#include <asm/prom.h>
 
 static struct of_pdt_ops *of_pdt_prom_ops __initdata;
 
Signature · 6 lines
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#6 lore raw

PATCH 3/21 ARM: keystone: remove unnecessary prom.h include

In reply to Rob Herring

From: Rob Herring <[email protected]>

Remove unnecessary prom.h include in preparation to make prom.h optional.

Cc Santosh Shilimkar <[email protected]>
---
 arch/arm/mach-keystone/platsmp.c | 1 -
 1 file changed, 1 deletion(-)
arch/arm/mach-keystone/platsmp.c +0 -1
index c122961..5cf0683 100644
@@ -17,7 +17,6 @@
 #include <linux/io.h>
 
 #include <asm/smp_plat.h>
-#include <asm/prom.h>
 
 #include "keystone.h"
 
Signature · 1 line
1.8.1.2
#7 lore raw

PATCH 4/21 arm64: remove unnecessary prom.h include

In reply to Rob Herring

From: Rob Herring <[email protected]>

Remove unnecessary prom.h include in preparation to make prom.h optional.

Cc Catalin Marinas <[email protected]>
Cc Will Deacon <[email protected]>
---
 arch/arm64/mm/init.c | 1 -
 1 file changed, 1 deletion(-)
arch/arm64/mm/init.c +0 -1
index de2de5d..c4b651e 100644
@@ -31,7 +31,6 @@
 #include <linux/sort.h>
 #include <linux/of_fdt.h>
 
-#include <asm/prom.h>
 #include <asm/sections.h>
 #include <asm/setup.h>
 #include <asm/sizes.h>
Signature · 1 line
1.8.1.2
#9 lore raw

PATCH 5/21 openrisc: remove unnecessary prom.h include

In reply to Rob Herring

From: Rob Herring <[email protected]>

Remove unnecessary prom.h include in preparation to make prom.h optional.

---
 arch/openrisc/kernel/prom.c | 1 -
 1 file changed, 1 deletion(-)
arch/openrisc/kernel/prom.c +0 -1
index a63e768..a915dc7 100644
@@ -37,7 +37,6 @@
 #include <linux/memblock.h>
 #include <linux/of_fdt.h>
 
-#include <asm/prom.h>
 #include <asm/page.h>
 #include <asm/processor.h>
 #include <asm/irq.h>
Signature · 1 line
1.8.1.2
#10 lore raw

PATCH 6/21 arc: remove unnecessary prom.h includes

In reply to Rob Herring

From: Rob Herring <[email protected]>

Remove unnecessary prom.h includes in preparation to remove prom.h.

---
 arch/arc/kernel/devtree.c | 1 -
 arch/arc/kernel/setup.c   | 1 -
 2 files changed, 2 deletions(-)
arch/arc/kernel/devtree.c +0 -1
index 2340af0..6fb5137 100644
@@ -14,7 +14,6 @@
 #include <linux/memblock.h>
 #include <linux/of.h>
 #include <linux/of_fdt.h>
-#include <asm/prom.h>
 #include <asm/clk.h>
 #include <asm/mach_desc.h>
 
arch/arc/kernel/setup.c +0 -1
index 2c68bc7e..f30cf31 100644
@@ -21,7 +21,6 @@
 #include <asm/setup.h>
 #include <asm/page.h>
 #include <asm/irq.h>
-#include <asm/prom.h>
 #include <asm/unwind.h>
 #include <asm/clk.h>
 #include <asm/mach_desc.h>
Signature · 1 line
1.8.1.2
#12 lore raw

PATCH 7/21 hexagon: remove unnecessary prom.h includes

In reply to Rob Herring

From: Rob Herring <[email protected]>

Hexagon does not have a prom.h header, so it is probably broken with CONFIG_OF enabled. In any case, remove unnecessary prom.h include in preparation to make prom.h optional.

---
 arch/hexagon/kernel/setup.c | 3 ---
 1 file changed, 3 deletions(-)
arch/hexagon/kernel/setup.c +0 -3
index 29d1f1b..0e7c1db 100644
@@ -32,9 +32,6 @@
 #include <asm/hexagon_vm.h>
 #include <asm/vm_mmu.h>
 #include <asm/time.h>
-#ifdef CONFIG_OF
-#include <asm/prom.h>
-#endif
 
 char cmd_line[COMMAND_LINE_SIZE];
 static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE;
Signature · 1 line
1.8.1.2
#14 lore raw

PATCH 8/21 metag: move setup_machine_fdt declaration from prom.h

In reply to Rob Herring

From: Rob Herring <[email protected]>

Move setup_machine_fdt out of prom.h and into asm/setup.h in preparation to remove prom.h.

---
 arch/metag/include/asm/prom.h  | 2 --
 arch/metag/include/asm/setup.h | 1 +
 arch/metag/kernel/setup.c      | 1 -
 3 files changed, 1 insertion(+), 3 deletions(-)
arch/metag/include/asm/prom.h +0 -2
index d2aa35d..e19022c 100644
@@ -14,10 +14,8 @@
 #ifndef __ASM_METAG_PROM_H
 #define __ASM_METAG_PROM_H
 
-#include <asm/setup.h>
 #define HAVE_ARCH_DEVTREE_FIXUPS
 
-extern struct machine_desc *setup_machine_fdt(void *dt);
 extern void copy_fdt(void);
 
 #endif /* __ASM_METAG_PROM_H */
arch/metag/include/asm/setup.h +1 -0
index e13083b..c7aedd4 100644
@@ -3,6 +3,7 @@
 
 #include <uapi/asm/setup.h>
 
+extern struct machine_desc *setup_machine_fdt(void *dt);
 void per_cpu_trap_init(unsigned long);
 extern void __init dump_machine_table(void);
 #endif /* _ASM_METAG_SETUP_H */
arch/metag/kernel/setup.c +0 -1
index c396cd0..5d5c2b8 100644
@@ -42,7 +42,6 @@
 #include <asm/mmu.h>
 #include <asm/mmzone.h>
 #include <asm/processor.h>
-#include <asm/prom.h>
 #include <asm/sections.h>
 #include <asm/setup.h>
 #include <asm/traps.h>
Signature · 1 line
1.8.1.2
#15 lore raw

PATCH 9/21 microblaze: clean-up prom.h implicit includes

In reply to Rob Herring

From: Rob Herring <rob.herring-bsGFqQB8/[email protected]>

While powerpc is a mess of implicit includes by prom.h, microblaze just copied this and is easily fixed. Add the necessary explicit includes and remove unnecessary includes and other parts from prom.h

---
 arch/microblaze/include/asm/prom.h          | 28 +---------------------------
 arch/microblaze/kernel/prom.c               |  1 +
 arch/microblaze/kernel/setup.c              |  1 +
 arch/microblaze/kernel/timer.c              |  1 +
 arch/microblaze/pci/pci-common.c            |  1 +
 drivers/net/ethernet/xilinx/ll_temac_main.c |  1 +
 6 files changed, 6 insertions(+), 27 deletions(-)
arch/microblaze/include/asm/prom.h +1 -27
index 9977816..f05bedc 100644
@@ -11,17 +11,10 @@
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
  */
-
-#include <linux/of.h>	/* linux/of.h gets to determine #include ordering */
-
 #ifndef _ASM_MICROBLAZE_PROM_H
 #define _ASM_MICROBLAZE_PROM_H
-#ifdef __KERNEL__
-#ifndef __ASSEMBLY__
 
-#include <linux/types.h>
-#include <asm/irq.h>
-#include <linux/atomic.h>
+#include <linux/of.h>
 
 #define HAVE_ARCH_DEVTREE_FIXUPS
 
@@ -42,23 +35,4 @@ extern unsigned long pci_address_to_pio(phys_addr_t address);
 #define pci_address_to_pio pci_address_to_pio
 #endif	/* CONFIG_PCI */
 
-/* Parse the ibm,dma-window property of an OF node into the busno, phys and
- * size parameters.
- */
-void of_parse_dma_window(struct device_node *dn, const void *dma_window_prop,
-		unsigned long *busno, unsigned long *phys, unsigned long *size);
-
-extern void kdump_move_device_tree(void);
-
-#endif /* __ASSEMBLY__ */
-#endif /* __KERNEL__ */
-
-/* These includes are put at the bottom because they may contain things
- * that are overridden by this file.  Ideally they shouldn't be included
- * by this file, but there are a bunch of .c files that currently depend
- * on it.  Eventually they will be cleaned up. */
-#include <linux/of_fdt.h>
-#include <linux/of_irq.h>
-#include <linux/platform_device.h>
-
 #endif /* _ASM_MICROBLAZE_PROM_H */
arch/microblaze/kernel/prom.c +1 -0
index 0c4453f..8118f03 100644
@@ -30,6 +30,7 @@
 #include <linux/debugfs.h>
 #include <linux/irq.h>
 #include <linux/memblock.h>
+#include <linux/of_fdt.h>
 
 #include <asm/prom.h>
 #include <asm/page.h>
arch/microblaze/kernel/setup.c +1 -0
index 0775e03..15b4ab1 100644
@@ -16,6 +16,7 @@
 #include <linux/initrd.h>
 #include <linux/console.h>
 #include <linux/debugfs.h>
+#include <linux/of_fdt.h>
 
 #include <asm/setup.h>
 #include <asm/sections.h>
arch/microblaze/kernel/timer.c +1 -0
index e4b3f33..827df4d 100644
@@ -15,6 +15,7 @@
 #include <linux/clk.h>
 #include <linux/clockchips.h>
 #include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <asm/cpuinfo.h>
 #include <linux/cnt32_to_63.h>
 
arch/microblaze/pci/pci-common.c +1 -0
index 1b93bf0..7c8a352 100644
@@ -29,6 +29,7 @@
 #include <linux/slab.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_pci.h>
 #include <linux/export.h>
 
drivers/net/ethernet/xilinx/ll_temac_main.c +1 -0
index b88121f..22478d5 100644
@@ -36,6 +36,7 @@
 #include <linux/netdevice.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
+#include <linux/of_irq.h>
 #include <linux/of_mdio.h>
 #include <linux/of_platform.h>
 #include <linux/of_address.h>
Signature · 6 lines
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#16 lore raw

PATCH 10/21 drivers: clean-up prom.h implicit includes

In reply to Rob Herring

From: Rob Herring <rob.herring-bsGFqQB8/[email protected]>

Powerpc is a mess of implicit includes by prom.h. Add the necessary explicit includes to drivers in preparation of prom.h cleanup.

---
 drivers/ata/sata_fsl.c                | 2 ++
 drivers/char/bsr.c                    | 1 +
 drivers/char/hw_random/pasemi-rng.c   | 1 +
 drivers/cpufreq/pasemi-cpufreq.c      | 1 +
 drivers/crypto/caam/ctrl.c            | 3 +++
 drivers/crypto/caam/jr.c              | 2 ++
 drivers/dma/fsldma.c                  | 2 ++
 drivers/edac/cell_edac.c              | 1 +
 drivers/i2c/busses/i2c-mpc.c          | 2 ++
 drivers/i2c/busses/i2c-powermac.c     | 1 +
 drivers/input/serio/xilinx_ps2.c      | 1 +
 drivers/macintosh/macio_asic.c        | 2 ++
 drivers/macintosh/rack-meter.c        | 2 ++
 drivers/macintosh/smu.c               | 1 +
 drivers/macintosh/via-pmu.c           | 2 ++
 drivers/mtd/nand/fsl_elbc_nand.c      | 1 +
 drivers/mtd/nand/pasemi_nand.c        | 2 ++
 drivers/net/ethernet/ibm/emac/core.c  | 2 ++
 drivers/net/ethernet/ibm/emac/mal.c   | 1 +
 drivers/net/ethernet/ibm/emac/rgmii.c | 1 +
 drivers/net/ethernet/ibm/emac/tah.c   | 1 +
 drivers/net/ethernet/ibm/emac/zmii.c  | 1 +
 drivers/pcmcia/electra_cf.c           | 2 ++
 drivers/tty/ehv_bytechan.c            | 1 +
 drivers/tty/serial/pmac_zilog.c       | 2 ++
 drivers/usb/host/ehci-ppc-of.c        | 2 ++
 drivers/usb/host/ohci-ppc-of.c        | 2 ++
 sound/aoa/core/gpio-feature.c         | 3 ++-
 sound/aoa/soundbus/i2sbus/core.c      | 2 ++
 sound/ppc/pmac.c                      | 2 ++
 sound/ppc/tumbler.c                   | 1 +
 31 files changed, 49 insertions(+), 1 deletion(-)
drivers/ata/sata_fsl.c +2 -0
index 851bd3f..fb0b40a 100644
@@ -24,6 +24,8 @@
 #include <scsi/scsi_cmnd.h>
 #include <linux/libata.h>
 #include <asm/io.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 
 static unsigned int intr_coalescing_count;
drivers/char/bsr.c +1 -0
index 0671e45..8fedbc2 100644
@@ -21,6 +21,7 @@
 
 #include <linux/kernel.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
 #include <linux/of_device.h>
 #include <linux/of_platform.h>
 #include <linux/fs.h>
drivers/char/hw_random/pasemi-rng.c +1 -0
index c6df5b2..c66279b 100644
@@ -24,6 +24,7 @@
 #include <linux/platform_device.h>
 #include <linux/hw_random.h>
 #include <linux/delay.h>
+#include <linux/of_address.h>
 #include <linux/of_platform.h>
 #include <asm/io.h>
 
drivers/cpufreq/pasemi-cpufreq.c +1 -0
index 534e43a..f4ec814 100644
@@ -28,6 +28,7 @@
 #include <linux/cpufreq.h>
 #include <linux/timer.h>
 #include <linux/module.h>
+#include <linux/of_address.h>
 
 #include <asm/hw_irq.h>
 #include <asm/io.h>
drivers/crypto/caam/ctrl.c +3 -0
index b010d42..3054870 100644
@@ -5,6 +5,9 @@
  * Copyright 2008-2012 Freescale Semiconductor, Inc.
  */
 
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
+
 #include "compat.h"
 #include "regs.h"
 #include "intern.h"
drivers/crypto/caam/jr.c +2 -0
index 105ba4d..94b80a9 100644
@@ -5,6 +5,8 @@
  * Copyright 2008-2012 Freescale Semiconductor, Inc.
  */
 
+#include <linux/of_irq.h>
+
 #include "compat.h"
 #include "regs.h"
 #include "jr.h"
drivers/dma/fsldma.c +2 -0
index b3f3e90..61517dd 100644
@@ -33,6 +33,8 @@
 #include <linux/delay.h>
 #include <linux/dma-mapping.h>
 #include <linux/dmapool.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 
 #include "dmaengine.h"
drivers/edac/cell_edac.c +1 -0
index c2eaf33..9ee1c76 100644
@@ -15,6 +15,7 @@
 #include <linux/platform_device.h>
 #include <linux/stop_machine.h>
 #include <linux/io.h>
+#include <linux/of_address.h>
 #include <asm/machdep.h>
 #include <asm/cell-regs.h>
 
drivers/i2c/busses/i2c-mpc.c +2 -0
index b80c768..b6a741c 100644
@@ -17,6 +17,8 @@
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/init.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/slab.h>
 
drivers/i2c/busses/i2c-powermac.c +1 -0
index 37e8cfa..8c87f4a 100644
@@ -27,6 +27,7 @@
 #include <linux/init.h>
 #include <linux/device.h>
 #include <linux/platform_device.h>
+#include <linux/of_irq.h>
 #include <asm/prom.h>
 #include <asm/pmac_low_i2c.h>
 
drivers/input/serio/xilinx_ps2.c +1 -0
index 4b7662a..b90eb4f 100644
@@ -25,6 +25,7 @@
 #include <linux/io.h>
 #include <linux/of_address.h>
 #include <linux/of_device.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 
 #define DRIVER_NAME		"xilinx_ps2"
drivers/macintosh/macio_asic.c +2 -0
index ac5c879..4f12c6f 100644
@@ -24,6 +24,8 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/slab.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 
 #include <asm/machdep.h>
 #include <asm/macio.h>
drivers/macintosh/rack-meter.c +2 -0
index cad0e19..4192901 100644
@@ -25,6 +25,8 @@
 #include <linux/pci.h>
 #include <linux/dma-mapping.h>
 #include <linux/kernel_stat.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 
 #include <asm/io.h>
 #include <asm/prom.h>
drivers/macintosh/smu.c +1 -0
index b3b2d36..23b4a3b 100644
@@ -35,6 +35,7 @@
 #include <linux/poll.h>
 #include <linux/mutex.h>
 #include <linux/of_device.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/slab.h>
 
drivers/macintosh/via-pmu.c +2 -0
index 283e1b5..dee88e5 100644
@@ -46,6 +46,8 @@
 #include <linux/suspend.h>
 #include <linux/cpu.h>
 #include <linux/compat.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <asm/prom.h>
 #include <asm/machdep.h>
 #include <asm/io.h>
drivers/mtd/nand/fsl_elbc_nand.c +1 -0
index 2065720..e59c886 100644
@@ -28,6 +28,7 @@
 #include <linux/kernel.h>
 #include <linux/string.h>
 #include <linux/ioport.h>
+#include <linux/of_address.h>
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/slab.h>
drivers/mtd/nand/pasemi_nand.c +2 -0
index 5a67082..4d17436 100644
@@ -28,6 +28,8 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/nand_ecc.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/pci.h>
drivers/net/ethernet/ibm/emac/core.c +2 -0
index 6b5c722..cdf2321 100644
@@ -39,6 +39,8 @@
 #include <linux/bitops.h>
 #include <linux/workqueue.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_net.h>
 #include <linux/slab.h>
 
drivers/net/ethernet/ibm/emac/mal.c +1 -0
index dac564c..4742ba3 100644
@@ -27,6 +27,7 @@
 
 #include <linux/delay.h>
 #include <linux/slab.h>
+#include <linux/of_irq.h>
 
 #include "core.h"
 #include <asm/dcr-regs.h>
drivers/net/ethernet/ibm/emac/rgmii.c +1 -0
index c47e23d..4fb2f96 100644
@@ -24,6 +24,7 @@
 #include <linux/slab.h>
 #include <linux/kernel.h>
 #include <linux/ethtool.h>
+#include <linux/of_address.h>
 #include <asm/io.h>
 
 #include "emac.h"
drivers/net/ethernet/ibm/emac/tah.c +1 -0
index c231a4a..9f24769 100644
@@ -18,6 +18,7 @@
  * Free Software Foundation;  either version 2 of the  License, or (at your
  * option) any later version.
  */
+#include <linux/of_address.h>
 #include <asm/io.h>
 
 #include "emac.h"
drivers/net/ethernet/ibm/emac/zmii.c +1 -0
index 4cdf286..9ca67a3 100644
@@ -24,6 +24,7 @@
 #include <linux/slab.h>
 #include <linux/kernel.h>
 #include <linux/ethtool.h>
+#include <linux/of_address.h>
 #include <asm/io.h>
 
 #include "emac.h"
drivers/pcmcia/electra_cf.c +2 -0
index a007321a..1b206ea 100644
@@ -30,6 +30,8 @@
 #include <linux/interrupt.h>
 #include <linux/mm.h>
 #include <linux/vmalloc.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/slab.h>
 
drivers/tty/ehv_bytechan.c +1 -0
index 9bffcec..0419b69 100644
@@ -32,6 +32,7 @@
 #include <linux/poll.h>
 #include <asm/epapr_hcalls.h>
 #include <linux/of.h>
+#include <linux/of_irq.h>
 #include <linux/platform_device.h>
 #include <linux/cdev.h>
 #include <linux/console.h>
drivers/tty/serial/pmac_zilog.c +2 -0
index f87f1a0..246b4c3 100644
@@ -57,6 +57,8 @@
 #include <linux/bitops.h>
 #include <linux/sysrq.h>
 #include <linux/mutex.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <asm/sections.h>
 #include <asm/io.h>
 #include <asm/irq.h>
drivers/usb/host/ehci-ppc-of.c +2 -0
index 932293f..2b1694e 100644
@@ -16,6 +16,8 @@
 #include <linux/signal.h>
 
 #include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 
 
drivers/usb/host/ohci-ppc-of.c +2 -0
index 75f5a1e..81f3eba 100644
@@ -14,6 +14,8 @@
  */
 
 #include <linux/signal.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 
 #include <asm/prom.h>
sound/aoa/core/gpio-feature.c +2 -1
index faa3174..f341539 100644
@@ -10,8 +10,9 @@
  * registers.
  */
 
-#include <asm/pmac_feature.h>
+#include <linux/of_irq.h>
 #include <linux/interrupt.h>
+#include <asm/pmac_feature.h>
 #include "../aoa.h"
 
 /* TODO: these are lots of global variables
sound/aoa/soundbus/i2sbus/core.c +2 -0
index 15e7613..4678360 100644
@@ -11,6 +11,8 @@
 #include <linux/pci.h>
 #include <linux/interrupt.h>
 #include <linux/dma-mapping.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 
 #include <sound/core.h>
 
sound/ppc/pmac.c +2 -0
index c93fbbb..7a43c0c 100644
@@ -28,6 +28,8 @@
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/dma-mapping.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <sound/core.h>
 #include "pmac.h"
 #include <sound/pcm_params.h>
sound/ppc/tumbler.c +1 -0
index b23354a..b9ffc17 100644
@@ -31,6 +31,7 @@
 #include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/string.h>
+#include <linux/of_irq.h>
 #include <sound/core.h>
 #include <asm/io.h>
 #include <asm/irq.h>
Signature · 6 lines
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#17 lore raw

PATCH 11/21 mips: add explicit includes of prom.h

In reply to Rob Herring

From: Rob Herring <[email protected]>

In preparation of removing prom.h include by of.h, add explicit includes.

---
 arch/mips/lantiq/prom.c           | 1 +
 arch/mips/mti-sead3/sead3-setup.c | 2 ++
 arch/mips/ralink/of.c             | 1 +
 3 files changed, 4 insertions(+)
arch/mips/lantiq/prom.c +1 -0
index 49c4603..19686c5 100644
@@ -14,6 +14,7 @@
 
 #include <asm/bootinfo.h>
 #include <asm/time.h>
+#include <asm/prom.h>
 
 #include <lantiq.h>
 
arch/mips/mti-sead3/sead3-setup.c +2 -0
index b5059dc..928ba84 100644
@@ -10,6 +10,8 @@
 #include <linux/of_fdt.h>
 #include <linux/bootmem.h>
 
+#include <asm/prom.h>
+
 #include <asm/mips-boards/generic.h>
 
 const char *get_system_type(void)
arch/mips/ralink/of.c +1 -0
index ce38d11..58c4fd52 100644
@@ -21,6 +21,7 @@
 #include <asm/reboot.h>
 #include <asm/bootinfo.h>
 #include <asm/addrspace.h>
+#include <asm/prom.h>
 
 #include "common.h"
 
Signature · 1 line
1.8.1.2
#18 lore raw

PATCH 12/21 x86: add necessary includes for prom.h

In reply to Rob Herring

From: Rob Herring <rob.herring-bsGFqQB8/[email protected]>

Once prom.h is no longer implicitly included, we need to include setup.h to get COMMAND_LINE_SIZE.

---
 arch/x86/kernel/devicetree.c | 1 +
 1 file changed, 1 insertion(+)
arch/x86/kernel/devicetree.c +1 -0
index 376dc78..c321a78 100644
@@ -20,6 +20,7 @@
 #include <asm/hpet.h>
 #include <asm/apic.h>
 #include <asm/pci_x86.h>
+#include <asm/setup.h>
 
 __initdata u64 initial_dtb;
 char __initdata cmd_line[COMMAND_LINE_SIZE];
Signature · 6 lines
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#19 lore raw

PATCH 13/21 of: implement pci_address_to_pio as weak function

In reply to Rob Herring

From: Rob Herring <[email protected]>

Implement pci_address_to_pio as weak function to remove the dependency on asm/prom.h. This is in preparation to make prom.h optional.

Cc Michal Simek <[email protected]>
Cc Ralf Baechle <[email protected]>
Cc Benjamin Herrenschmidt <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Grant Likely <[email protected]>
---
 arch/microblaze/include/asm/prom.h |  9 ---------
 arch/mips/include/asm/prom.h       | 11 -----------
 arch/powerpc/include/asm/prom.h    |  5 -----
 arch/x86/include/asm/prom.h        |  3 ---
 arch/x86/kernel/devicetree.c       | 10 ----------
 drivers/of/address.c               |  8 ++++++++
 drivers/of/of_pci.c                |  1 -
 include/linux/of_address.h         |  5 +----
 8 files changed, 9 insertions(+), 43 deletions(-)
arch/microblaze/include/asm/prom.h +0 -9
index f05bedc..0ebd924 100644
@@ -26,13 +26,4 @@ enum early_consoles {
 
 extern int of_early_console(void *version);
 
-/*
- * OF address retreival & translation
- */
-
-#ifdef CONFIG_PCI
-extern unsigned long pci_address_to_pio(phys_addr_t address);
-#define pci_address_to_pio pci_address_to_pio
-#endif	/* CONFIG_PCI */
-
 #endif /* _ASM_MICROBLAZE_PROM_H */
arch/mips/include/asm/prom.h +0 -11
index 1e7e096..a7b28f5 100644
@@ -22,17 +22,6 @@ extern int early_init_dt_scan_memory_arch(unsigned long node,
 
 extern void device_tree_init(void);
 
-static inline unsigned long pci_address_to_pio(phys_addr_t address)
-{
-	/*
-	 * The ioport address can be directly used by inX() / outX()
-	 */
-	BUG_ON(address > IO_SPACE_LIMIT);
-
-	return (unsigned long) address;
-}
-#define pci_address_to_pio pci_address_to_pio
-
 struct boot_param_header;
 
 extern void __dt_setup_arch(struct boot_param_header *bph);
arch/powerpc/include/asm/prom.h +0 -5
index 7d0c7f3..bd215f7 100644
@@ -30,11 +30,6 @@
 extern u64 of_translate_dma_address(struct device_node *dev,
 				    const __be32 *in_addr);
 
-#ifdef CONFIG_PCI
-extern unsigned long pci_address_to_pio(phys_addr_t address);
-#define pci_address_to_pio pci_address_to_pio
-#endif	/* CONFIG_PCI */
-
 /* Parse the ibm,dma-window property of an OF node into the busno, phys and
  * size parameters.
  */
arch/x86/include/asm/prom.h +0 -3
index bade6ac..8ef2ec7 100644
@@ -39,9 +39,6 @@ static inline void x86_dtb_init(void) { }
 
 extern char cmd_line[COMMAND_LINE_SIZE];
 
-#define pci_address_to_pio pci_address_to_pio
-unsigned long pci_address_to_pio(phys_addr_t addr);
-
 #define HAVE_ARCH_DEVTREE_FIXUPS
 
 #endif /* __ASSEMBLY__ */
arch/x86/kernel/devicetree.c +0 -10
index c321a78..e119918 100644
@@ -27,16 +27,6 @@ char __initdata cmd_line[COMMAND_LINE_SIZE];
 
 int __initdata of_ioapic;
 
-unsigned long pci_address_to_pio(phys_addr_t address)
-{
-	/*
-	 * The ioport address can be directly used by inX / outX
-	 */
-	BUG_ON(address >= (1 << 16));
-	return (unsigned long)address;
-}
-EXPORT_SYMBOL_GPL(pci_address_to_pio);
-
 void __init early_init_dt_scan_chosen_arch(unsigned long node)
 {
 	BUG();
drivers/of/address.c +8 -0
index b55c218..556a7fb 100644
@@ -626,6 +626,14 @@ const __be32 *of_get_address(struct device_node *dev, int index, u64 *size,
 }
 EXPORT_SYMBOL(of_get_address);
 
+unsigned long __weak pci_address_to_pio(phys_addr_t address)
+{
+	if (address > IO_SPACE_LIMIT)
+		return (unsigned long)-1;
+
+	return (unsigned long) address;
+}
+
 static int __of_address_to_resource(struct device_node *dev,
 		const __be32 *addrp, u64 size, unsigned int flags,
 		const char *name, struct resource *r)
drivers/of/of_pci.c +0 -1
index e5ca008..8481996 100644
@@ -2,7 +2,6 @@
 #include <linux/export.h>
 #include <linux/of.h>
 #include <linux/of_pci.h>
-#include <asm/prom.h>
 
 static inline int __of_pci_pci_compare(struct device_node *node,
 				       unsigned int data)
include/linux/of_address.h +1 -4
index 4c2e6f2..f6fc689 100644
@@ -52,10 +52,7 @@ extern void __iomem *of_iomap(struct device_node *device, int index);
 extern const __be32 *of_get_address(struct device_node *dev, int index,
 			   u64 *size, unsigned int *flags);
 
-#ifndef pci_address_to_pio
-static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; }
-#define pci_address_to_pio pci_address_to_pio
-#endif
+extern unsigned long pci_address_to_pio(phys_addr_t addr);
 
 extern int of_pci_range_parser_init(struct of_pci_range_parser *parser,
 			struct device_node *node);
Signature · 1 line
1.8.1.2
#20 lore raw

PATCH 14/21 of: implement of_node_to_nid as a weak function

In reply to Rob Herring

From: Rob Herring <[email protected]>

Implement of_node_to_nid as weak function to remove the dependency on asm/prom.h. This is in preparation to make prom.h optional.

---
 arch/powerpc/include/asm/prom.h |  7 -------
 arch/sparc/include/asm/prom.h   |  4 ----
 drivers/of/base.c               |  7 +++++++
 include/linux/of.h              | 11 ++++-------
 4 files changed, 11 insertions(+), 18 deletions(-)
arch/powerpc/include/asm/prom.h +0 -7
index bd215f7..6707c16 100644
@@ -42,13 +42,6 @@ extern void kdump_move_device_tree(void);
 /* cache lookup */
 struct device_node *of_find_next_cache_node(struct device_node *np);
 
-#ifdef CONFIG_NUMA
-extern int of_node_to_nid(struct device_node *device);
-#else
-static inline int of_node_to_nid(struct device_node *device) { return 0; }
-#endif
-#define of_node_to_nid of_node_to_nid
-
 extern void of_instantiate_rtc(void);
 
 extern int of_get_ibm_chip_id(struct device_node *np);
arch/sparc/include/asm/prom.h +0 -4
index 67c6257..60c8d7b 100644
@@ -43,10 +43,6 @@ extern int of_getintprop_default(struct device_node *np,
 				 const char *name,
 				 int def);
 extern int of_find_in_proplist(const char *list, const char *match, int len);
-#ifdef CONFIG_NUMA
-extern int of_node_to_nid(struct device_node *dp);
-#define of_node_to_nid of_node_to_nid
-#endif
 
 extern void prom_build_devicetree(void);
 extern void of_populate_present_mask(void);
drivers/of/base.c +7 -0
index 865d3f6..ced4c06 100644
@@ -74,6 +74,13 @@ int of_n_size_cells(struct device_node *np)
 }
 EXPORT_SYMBOL(of_n_size_cells);
 
+#ifdef CONFIG_NUMA
+int __weak of_node_to_nid(struct device_node *np)
+{
+	return numa_node_id();
+}
+#endif
+
 #if defined(CONFIG_OF_DYNAMIC)
 /**
  *	of_node_get - Increment refcount of a node
include/linux/of.h +4 -7
index f95aee3..4d294a0 100644
@@ -534,13 +534,10 @@ static inline const char *of_prop_next_string(struct property *prop,
 #define of_match_node(_matches, _node)	NULL
 #endif /* CONFIG_OF */
 
-#ifndef of_node_to_nid
-static inline int of_node_to_nid(struct device_node *np)
-{
-	return numa_node_id();
-}
-
-#define of_node_to_nid of_node_to_nid
+#if defined(CONFIG_OF) && defined(CONFIG_NUMA)
+extern int of_node_to_nid(struct device_node *np);
+#else
+static inline int of_node_to_nid(struct device_node *device) { return 0; }
 #endif
 
 /**
Signature · 1 line
1.8.1.2
#22 lore raw

PATCH 15/21 of: remove HAVE_ARCH_DEVTREE_FIXUPS

In reply to Rob Herring

From: Rob Herring <[email protected]>

HAVE_ARCH_DEVTREE_FIXUPS appears to always be needed except for sparc, but it is only used for /proc/device-teee and sparc does not enable /proc/device-tree. So this option is redundant. Remove the option and always enable it. This has the side effect of fixing /proc/device-tree on arches such as arm64 which failed to define this option.

Cc Vineet Gupta <[email protected]>
Cc Russell King <[email protected]>
Cc James Hogan <[email protected]>
Cc Michal Simek <[email protected]>
Cc Jonas Bonn <[email protected]>
Cc Benjamin Herrenschmidt <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Chris Zankel <[email protected]>
Cc Max Filippov <[email protected]>
---
 arch/arc/include/asm/prom.h        | 2 --
 arch/arm/include/asm/prom.h        | 2 --
 arch/metag/include/asm/prom.h      | 1 -
 arch/microblaze/include/asm/prom.h | 2 --
 arch/openrisc/include/asm/prom.h   | 2 --
 arch/powerpc/include/asm/prom.h    | 2 --
 arch/x86/include/asm/prom.h        | 2 --
 arch/xtensa/include/asm/prom.h     | 2 --
 fs/proc/proc_devtree.c             | 3 ---
 9 files changed, 18 deletions(-)
arch/arc/include/asm/prom.h +0 -2
index 692d0d0..1555549 100644
@@ -9,6 +9,4 @@
 #ifndef _ASM_ARC_PROM_H_
 #define _ASM_ARC_PROM_H_
 
-#define HAVE_ARCH_DEVTREE_FIXUPS
-
 #endif
arch/arm/include/asm/prom.h +0 -2
index 4a2985e..b681575 100644
@@ -11,8 +11,6 @@
 #ifndef __ASMARM_PROM_H
 #define __ASMARM_PROM_H
 
-#define HAVE_ARCH_DEVTREE_FIXUPS
-
 #ifdef CONFIG_OF
 
 extern const struct machine_desc *setup_machine_fdt(unsigned int dt_phys);
arch/metag/include/asm/prom.h +0 -1
index e19022c..d4be144 100644
@@ -14,7 +14,6 @@
 #ifndef __ASM_METAG_PROM_H
 #define __ASM_METAG_PROM_H
 
-#define HAVE_ARCH_DEVTREE_FIXUPS
 
 extern void copy_fdt(void);
 
arch/microblaze/include/asm/prom.h +0 -2
index 0ebd924..2f03ac8 100644
@@ -16,8 +16,6 @@
 
 #include <linux/of.h>
 
-#define HAVE_ARCH_DEVTREE_FIXUPS
-
 /* Other Prototypes */
 enum early_consoles {
 	UARTLITE = 1,
arch/openrisc/include/asm/prom.h +0 -2
index 93c9980..bec477b 100644
@@ -17,6 +17,4 @@
 #ifndef _ASM_OPENRISC_PROM_H
 #define _ASM_OPENRISC_PROM_H
 
-#define HAVE_ARCH_DEVTREE_FIXUPS
-
 #endif /* _ASM_OPENRISC_PROM_H */
arch/powerpc/include/asm/prom.h +0 -2
index 6707c16..43fe002 100644
@@ -20,8 +20,6 @@
 #include <asm/irq.h>
 #include <linux/atomic.h>
 
-#define HAVE_ARCH_DEVTREE_FIXUPS
-
 /*
  * OF address retreival & translation
  */
arch/x86/include/asm/prom.h +0 -2
index 8ef2ec7..fbeb06e 100644
@@ -39,7 +39,5 @@ static inline void x86_dtb_init(void) { }
 
 extern char cmd_line[COMMAND_LINE_SIZE];
 
-#define HAVE_ARCH_DEVTREE_FIXUPS
-
 #endif /* __ASSEMBLY__ */
 #endif
arch/xtensa/include/asm/prom.h +0 -2
index f3d7cd2..2a87a58 100644
@@ -1,6 +1,4 @@
 #ifndef _XTENSA_ASM_PROM_H
 #define _XTENSA_ASM_PROM_H
 
-#define HAVE_ARCH_DEVTREE_FIXUPS
-
 #endif /* _XTENSA_ASM_PROM_H */
fs/proc/proc_devtree.c +0 -3
index 106a835..70779b2 100644
@@ -14,16 +14,13 @@
 #include <linux/of.h>
 #include <linux/export.h>
 #include <linux/slab.h>
-#include <asm/prom.h>
 #include <asm/uaccess.h>
 #include "internal.h"
 
 static inline void set_node_proc_entry(struct device_node *np,
 				       struct proc_dir_entry *de)
 {
-#ifdef HAVE_ARCH_DEVTREE_FIXUPS
 	np->pde = de;
-#endif
 }
 
 static struct proc_dir_entry *proc_device_tree;
Signature · 1 line
1.8.1.2
#24 lore raw

PATCH 16/21 of: move of_address_to_resource and of_iomap declarations from sparc

In reply to Rob Herring

From: Rob Herring <[email protected]>

Move of_address_to_resource and of_iomap declarations to common code. These only differ on sparc, but the declarations are the same and don't need to be in arch header.

Cc "David S. Miller" <[email protected]>
Cc Grant Likely <[email protected]>
---
 arch/sparc/include/asm/prom.h |  8 --------
 include/linux/of_address.h    | 30 +++++++++++++++++-------------
 2 files changed, 17 insertions(+), 21 deletions(-)
arch/sparc/include/asm/prom.h +0 -8
index 60c8d7b..11ebd65 100644
@@ -59,13 +59,5 @@ extern char *of_console_options;
 extern void irq_trans_init(struct device_node *dp);
 extern char *build_path_component(struct device_node *dp);
 
-/* SPARC has local implementations */
-extern int of_address_to_resource(struct device_node *dev, int index,
-				  struct resource *r);
-#define of_address_to_resource of_address_to_resource
-
-void __iomem *of_iomap(struct device_node *node, int index);
-#define of_iomap of_iomap
-
 #endif /* __KERNEL__ */
 #endif /* _SPARC_PROM_H */
include/linux/of_address.h +17 -13
index f6fc689..e8a1797 100644
@@ -60,13 +60,6 @@ extern struct of_pci_range *of_pci_range_parser_one(
 					struct of_pci_range_parser *parser,
 					struct of_pci_range *range);
 #else /* CONFIG_OF_ADDRESS */
-#ifndef of_address_to_resource
-static inline int of_address_to_resource(struct device_node *dev, int index,
-					 struct resource *r)
-{
-	return -EINVAL;
-}
-#endif
 static inline struct device_node *of_find_matching_node_by_address(
 					struct device_node *from,
 					const struct of_device_id *matches,
@@ -74,12 +67,7 @@ static inline struct device_node *of_find_matching_node_by_address(
 {
 	return NULL;
 }
-#ifndef of_iomap
-static inline void __iomem *of_iomap(struct device_node *device, int index)
-{
-	return NULL;
-}
-#endif
+
 static inline const __be32 *of_get_address(struct device_node *dev, int index,
 					u64 *size, unsigned int *flags)
 {
@@ -100,6 +88,22 @@ static inline struct of_pci_range *of_pci_range_parser_one(
 }
 #endif /* CONFIG_OF_ADDRESS */
 
+#ifdef CONFIG_OF
+extern int of_address_to_resource(struct device_node *dev, int index,
+				  struct resource *r);
+void __iomem *of_iomap(struct device_node *node, int index);
+#else
+static inline int of_address_to_resource(struct device_node *dev, int index,
+					 struct resource *r)
+{
+	return -EINVAL;
+}
+
+static inline void __iomem *of_iomap(struct device_node *device, int index)
+{
+	return NULL;
+}
+#endif
 
 #if defined(CONFIG_OF_ADDRESS) && defined(CONFIG_PCI)
 extern const __be32 *of_get_pci_address(struct device_node *dev, int bar_no,
Signature · 1 line
1.8.1.2
#25 lore raw

PATCH 17/21 of: move of_translate_dma_address to of_address.h

In reply to Rob Herring

From: Rob Herring <[email protected]>

of_translate_dma_address is implemented in common code, so move the declaration there too.

Cc Benjamin Herrenschmidt <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Grant Likely <[email protected]>
---
 arch/powerpc/include/asm/prom.h | 4 ----
 include/linux/of_address.h      | 4 ++++
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/powerpc/include/asm/prom.h +0 -4
index 43fe002..b8774bd 100644
@@ -24,10 +24,6 @@
  * OF address retreival & translation
  */
 
-/* Translate a DMA address from device space to CPU space */
-extern u64 of_translate_dma_address(struct device_node *dev,
-				    const __be32 *in_addr);
-
 /* Parse the ibm,dma-window property of an OF node into the busno, phys and
  * size parameters.
  */
include/linux/of_address.h +4 -0
index e8a1797..5f6ed6b 100644
@@ -34,6 +34,10 @@ static inline void of_pci_range_to_resource(struct of_pci_range *range,
 	res->name = np->full_name;
 }
 
+/* Translate a DMA address from device space to CPU space */
+extern u64 of_translate_dma_address(struct device_node *dev,
+				    const __be32 *in_addr);
+
 #ifdef CONFIG_OF_ADDRESS
 extern u64 of_translate_address(struct device_node *np, const __be32 *addr);
 extern bool of_can_translate_address(struct device_node *dev);
Signature · 1 line
1.8.1.2
#26 lore raw

PATCH 18/21 powerpc: clean-up include ordering in prom.h

In reply to Rob Herring

From: Rob Herring <[email protected]>

Now that the core OF headers don't depend on prom.h, rearrange the includes. There are still lots of implicit includes in the powerpc tree, so the includes of OF headers are still necessary.

---
 arch/powerpc/include/asm/prom.h | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)
arch/powerpc/include/asm/prom.h +7 -10
index b8774bd..7687f82 100644
@@ -1,4 +1,3 @@
-#include <linux/of.h>	/* linux/of.h gets to determine #include ordering */
 #ifndef _POWERPC_PROM_H
 #define _POWERPC_PROM_H
 #ifdef __KERNEL__
@@ -20,6 +19,13 @@
 #include <asm/irq.h>
 #include <linux/atomic.h>
 
+/* These includes should be removed once implicit includes are cleaned up. */
+#include <linux/of.h>
+#include <linux/of_fdt.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
+#include <linux/platform_device.h>
+
 /*
  * OF address retreival & translation
  */
@@ -125,14 +131,5 @@ struct of_drconf_cell {
  */
 extern unsigned char ibm_architecture_vec[];
 
-/* These includes are put at the bottom because they may contain things
- * that are overridden by this file.  Ideally they shouldn't be included
- * by this file, but there are a bunch of .c files that currently depend
- * on it.  Eventually they will be cleaned up. */
-#include <linux/of_fdt.h>
-#include <linux/of_address.h>
-#include <linux/of_irq.h>
-#include <linux/platform_device.h>
-
 #endif /* __KERNEL__ */
 #endif /* _POWERPC_PROM_H */
Signature · 1 line
1.8.1.2
#27 lore raw

PATCH 19/21 powerpc: add explicit OF includes

In reply to Rob Herring

From: Rob Herring <[email protected]>

When removing prom.h include by of.h, several OF headers will no longer be implicitly included. Add explicit includes of of_*.h as needed.

Cc Benjamin Herrenschmidt <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Anatolij Gustschin <[email protected]>
Cc Kumar Gala <[email protected]>
Cc Olof Johansson <[email protected]>
---
 arch/powerpc/kernel/epapr_paravirt.c             | 1 +
 arch/powerpc/platforms/512x/clock.c              | 1 +
 arch/powerpc/platforms/512x/pdm360ng.c           | 2 ++
 arch/powerpc/platforms/82xx/mpc8272_ads.c        | 2 ++
 arch/powerpc/platforms/82xx/pq2fads.c            | 2 ++
 arch/powerpc/platforms/83xx/suspend.c            | 2 ++
 arch/powerpc/platforms/86xx/pic.c                | 1 +
 arch/powerpc/platforms/embedded6xx/flipper-pic.c | 1 +
 arch/powerpc/platforms/embedded6xx/hlwd-pic.c    | 2 ++
 arch/powerpc/platforms/pasemi/gpio_mdio.c        | 1 +
 arch/powerpc/platforms/powermac/pfunc_base.c     | 1 +
 arch/powerpc/platforms/powernv/opal-lpc.c        | 1 +
 arch/powerpc/platforms/powernv/opal.c            | 1 +
 arch/powerpc/platforms/powernv/setup.c           | 1 +
 arch/powerpc/platforms/pseries/hotplug-memory.c  | 2 ++
 arch/powerpc/sysdev/cpm_common.c                 | 1 +
 arch/powerpc/sysdev/fsl_gtm.c                    | 2 ++
 arch/powerpc/sysdev/fsl_pmc.c                    | 1 +
 arch/powerpc/sysdev/mpic.c                       | 8 ++++----
 arch/powerpc/sysdev/mpic_timer.c                 | 2 ++
 20 files changed, 31 insertions(+), 4 deletions(-)
arch/powerpc/kernel/epapr_paravirt.c +1 -0
index 6300c13..7898be9 100644
@@ -18,6 +18,7 @@
  */
 
 #include <linux/of.h>
+#include <linux/of_fdt.h>
 #include <asm/epapr_hcalls.h>
 #include <asm/cacheflush.h>
 #include <asm/code-patching.h>
arch/powerpc/platforms/512x/clock.c +1 -0
index e504166..fd8a376 100644
@@ -24,6 +24,7 @@
 #include <linux/mutex.h>
 #include <linux/io.h>
 
+#include <linux/of_address.h>
 #include <linux/of_platform.h>
 #include <asm/mpc5xxx.h>
 #include <asm/mpc5121.h>
arch/powerpc/platforms/512x/pdm360ng.c +2 -0
index 24b314d..116f2325 100644
@@ -14,6 +14,8 @@
 
 #include <linux/kernel.h>
 #include <linux/io.h>
+#include <linux/of_address.h>
+#include <linux/of_fdt.h>
 #include <linux/of_platform.h>
 
 #include <asm/machdep.h>
arch/powerpc/platforms/82xx/mpc8272_ads.c +2 -0
index 30394b4..6a14cf5 100644
@@ -16,6 +16,8 @@
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/fsl_devices.h>
+#include <linux/of_address.h>
+#include <linux/of_fdt.h>
 #include <linux/of_platform.h>
 #include <linux/io.h>
 
arch/powerpc/platforms/82xx/pq2fads.c +2 -0
index e1dceee..e5f82ec 100644
@@ -15,6 +15,8 @@
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/fsl_devices.h>
+#include <linux/of_address.h>
+#include <linux/of_fdt.h>
 #include <linux/of_platform.h>
 
 #include <asm/io.h>
arch/powerpc/platforms/83xx/suspend.c +2 -0
index 1d769a2..3d9716c 100644
@@ -20,6 +20,8 @@
 #include <linux/freezer.h>
 #include <linux/suspend.h>
 #include <linux/fsl_devices.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <linux/export.h>
 
arch/powerpc/platforms/86xx/pic.c +1 -0
index 9982f57..d5b98c0 100644
@@ -10,6 +10,7 @@
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
+#include <linux/of_irq.h>
 #include <linux/of_platform.h>
 
 #include <asm/mpic.h>
arch/powerpc/platforms/embedded6xx/flipper-pic.c +1 -0
index 53d6eee0..4cde8e7 100644
@@ -18,6 +18,7 @@
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
 #include <asm/io.h>
 
 #include "flipper-pic.h"
arch/powerpc/platforms/embedded6xx/hlwd-pic.c +2 -0
index 3006b51..7cab21d 100644
@@ -18,6 +18,8 @@
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <asm/io.h>
 
 #include "hlwd-pic.h"
arch/powerpc/platforms/pasemi/gpio_mdio.c +1 -0
index 0237ab7..15adee5 100644
@@ -30,6 +30,7 @@
 #include <linux/ioport.h>
 #include <linux/interrupt.h>
 #include <linux/phy.h>
+#include <linux/of_address.h>
 #include <linux/of_mdio.h>
 #include <linux/of_platform.h>
 
arch/powerpc/platforms/powermac/pfunc_base.c +1 -0
index f5e3cda..e49d07f 100644
@@ -4,6 +4,7 @@
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
 #include <linux/spinlock.h>
+#include <linux/of_irq.h>
 
 #include <asm/pmac_feature.h>
 #include <asm/pmac_pfunc.h>
arch/powerpc/platforms/powernv/opal-lpc.c +1 -0
index a7614bb..e7e59e4 100644
@@ -17,6 +17,7 @@
 #include <asm/firmware.h>
 #include <asm/xics.h>
 #include <asm/opal.h>
+#include <asm/prom.h>
 
 static int opal_lpc_chip_id = -1;
 
arch/powerpc/platforms/powernv/opal.c +1 -0
index 2911abe..f36ff35 100644
@@ -13,6 +13,7 @@
 
 #include <linux/types.h>
 #include <linux/of.h>
+#include <linux/of_fdt.h>
 #include <linux/of_platform.h>
 #include <linux/interrupt.h>
 #include <linux/notifier.h>
arch/powerpc/platforms/powernv/setup.c +1 -0
index e239dcf..19884b2 100644
@@ -23,6 +23,7 @@
 #include <linux/irq.h>
 #include <linux/seq_file.h>
 #include <linux/of.h>
+#include <linux/of_fdt.h>
 #include <linux/interrupt.h>
 #include <linux/bug.h>
 
arch/powerpc/platforms/pseries/hotplug-memory.c +2 -0
index 9a432de..9590dbb 100644
@@ -10,12 +10,14 @@
  */
 
 #include <linux/of.h>
+#include <linux/of_address.h>
 #include <linux/memblock.h>
 #include <linux/vmalloc.h>
 #include <linux/memory.h>
 
 #include <asm/firmware.h>
 #include <asm/machdep.h>
+#include <asm/prom.h>
 #include <asm/sparsemem.h>
 
 static unsigned long get_memblock_size(void)
arch/powerpc/sysdev/cpm_common.c +1 -0
index 4dd5341..4f78695 100644
@@ -22,6 +22,7 @@
 #include <linux/spinlock.h>
 #include <linux/export.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
 #include <linux/slab.h>
 
 #include <asm/udbg.h>
arch/powerpc/sysdev/fsl_gtm.c +2 -0
index 0eb871c..1b980ee 100644
@@ -19,6 +19,8 @@
 #include <linux/list.h>
 #include <linux/io.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/of_irq.h>
 #include <linux/spinlock.h>
 #include <linux/bitops.h>
 #include <linux/slab.h>
arch/powerpc/sysdev/fsl_pmc.c +1 -0
index 592a0f8..8cf4aa0 100644
@@ -18,6 +18,7 @@
 #include <linux/suspend.h>
 #include <linux/delay.h>
 #include <linux/device.h>
+#include <linux/of_address.h>
 #include <linux/of_platform.h>
 
 struct pmc_regs {
arch/powerpc/sysdev/mpic.c +4 -4
index 1be54fa..2d30eaf 100644
@@ -535,7 +535,7 @@ static void __init mpic_scan_ht_pic(struct mpic *mpic, u8 __iomem *devbase,
 		mpic->fixups[irq].data = readl(base + 4) | 0x80000000;
 	}
 }
- 
+
 
 static void __init mpic_scan_ht_pics(struct mpic *mpic)
 {
@@ -1475,7 +1475,7 @@ struct mpic * __init mpic_alloc(struct device_node *node,
 	 * as a default instead of the value read from the HW.
 	 */
 	last_irq = (greg_feature & MPIC_GREG_FEATURE_LAST_SRC_MASK)
-				>> MPIC_GREG_FEATURE_LAST_SRC_SHIFT;	
+				>> MPIC_GREG_FEATURE_LAST_SRC_SHIFT;
 	if (isu_size)
 		last_irq = isu_size  * MPIC_MAX_ISU - 1;
 	of_property_read_u32(mpic->node, "last-interrupt-source", &last_irq);
@@ -1625,7 +1625,7 @@ void __init mpic_init(struct mpic *mpic)
 			/* start with vector = source number, and masked */
 			u32 vecpri = MPIC_VECPRI_MASK | i |
 				(8 << MPIC_VECPRI_PRIORITY_SHIFT);
-		
+
 			/* check if protected */
 			if (mpic->protected && test_bit(i, mpic->protected))
 				continue;
@@ -1634,7 +1634,7 @@ void __init mpic_init(struct mpic *mpic)
 			mpic_irq_write(i, MPIC_INFO(IRQ_DESTINATION), 1 << cpu);
 		}
 	}
-	
+
 	/* Init spurious vector */
 	mpic_write(mpic->gregs, MPIC_INFO(GREG_SPURIOUS), mpic->spurious_vec);
 
arch/powerpc/sysdev/mpic_timer.c +2 -0
index c06db92..22d7d57 100644
@@ -19,7 +19,9 @@
 #include <linux/interrupt.h>
 #include <linux/slab.h>
 #include <linux/of.h>
+#include <linux/of_address.h>
 #include <linux/of_device.h>
+#include <linux/of_irq.h>
 #include <linux/syscore_ops.h>
 #include <sysdev/fsl_soc.h>
 #include <asm/io.h>
Signature · 1 line
1.8.1.2
#28 lore raw

PATCH 20/21 of: only include prom.h on sparc

In reply to Rob Herring

From: Rob Herring <rob.herring-bsGFqQB8/[email protected]>

The dependency on prom.h by the core DT code is now removed and only sparc needs to include prom.h for the core code.

---
 include/linux/of.h | 2 ++
 1 file changed, 2 insertions(+)
include/linux/of.h +2 -0
index 4d294a0..54017b8 100644
@@ -136,7 +136,9 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size)
 	return of_read_number(cell, size);
 }
 
+#if defined(CONFIG_SPARC)
 #include <asm/prom.h>
+#endif
 
 /* Default #address and #size cells.  Allow arch asm/prom.h to override */
 #if !defined(OF_ROOT_NODE_ADDR_CELLS_DEFAULT)
Signature · 6 lines
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#29 lore raw

PATCH 21/21 of: remove empty arch prom.h headers

In reply to Rob Herring

From: Rob Herring <rob.herring-bsGFqQB8/[email protected]>

Now that prom.h is optional, all the empty prom.h headers can be removed.

Cc Vineet Gupta <vgupta-HKixBCOQz3hWk0Htik3J/[email protected]>
Cc Catalin Marinas <[email protected]>
Cc Will Deacon <[email protected]>
Cc Mark Salter <[email protected]>
Cc Aurelien Jacquiot <[email protected]>
Cc James Hogan <[email protected]>
Cc Jonas Bonn <[email protected]>
Cc Chris Zankel <[email protected]>
Cc Max Filippov <[email protected]>
---
 arch/arc/include/asm/prom.h      | 12 ------------
 arch/arm64/include/asm/prom.h    |  1 -
 arch/c6x/include/asm/prom.h      |  1 -
 arch/metag/include/asm/prom.h    | 20 --------------------
 arch/openrisc/include/asm/prom.h | 20 --------------------
 arch/xtensa/include/asm/prom.h   |  4 ----
 6 files changed, 58 deletions(-)
 delete mode 100644 arch/arc/include/asm/prom.h
 delete mode 100644 arch/arm64/include/asm/prom.h
 delete mode 100644 arch/c6x/include/asm/prom.h
 delete mode 100644 arch/metag/include/asm/prom.h
 delete mode 100644 arch/openrisc/include/asm/prom.h
 delete mode 100644 arch/xtensa/include/asm/prom.h
arch/arc/include/asm/prom.h deleted +0 -12
deleted file mode 100644
index 1555549..0000000
@@ -1,12 +0,0 @@
-/*
- * Copyright (C) 2012 Synopsys, Inc. (www.synopsys.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef _ASM_ARC_PROM_H_
-#define _ASM_ARC_PROM_H_
-
-#endif
arch/arm64/include/asm/prom.h deleted +0 -1
deleted file mode 100644
index 68b90e6..0000000
@@ -1 +0,0 @@
-/* Empty for now */
arch/c6x/include/asm/prom.h deleted +0 -1
deleted file mode 100644
index b4ec95f0..0000000
@@ -1 +0,0 @@
-/* dummy prom.h; here to make linux/of.h's #includes happy */
arch/metag/include/asm/prom.h deleted +0 -20
deleted file mode 100644
index d4be144..0000000
@@ -1,20 +0,0 @@
-/*
- *  arch/metag/include/asm/prom.h
- *
- *  Copyright (C) 2012 Imagination Technologies Ltd.
- *
- *  Based on ARM version:
- *  Copyright (C) 2009 Canonical Ltd. <[email protected]>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- */
-#ifndef __ASM_METAG_PROM_H
-#define __ASM_METAG_PROM_H
-
-
-extern void copy_fdt(void);
-
-#endif /* __ASM_METAG_PROM_H */
arch/openrisc/include/asm/prom.h deleted +0 -20
deleted file mode 100644
index bec477b..0000000
@@ -1,20 +0,0 @@
-/*
- * OpenRISC Linux
- *
- * Linux architectural port borrowing liberally from similar works of
- * others.  All original copyrights apply as per the original source
- * declaration.
- *
- * OpenRISC implementation:
- * Copyright (C) 2010-2011 Jonas Bonn <[email protected]>
- * et al.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-#ifndef _ASM_OPENRISC_PROM_H
-#define _ASM_OPENRISC_PROM_H
-
-#endif /* _ASM_OPENRISC_PROM_H */
arch/xtensa/include/asm/prom.h deleted +0 -4
deleted file mode 100644
index 2a87a58..0000000
@@ -1,4 +0,0 @@
-#ifndef _XTENSA_ASM_PROM_H
-#define _XTENSA_ASM_PROM_H
-
-#endif /* _XTENSA_ASM_PROM_H */
Signature · 6 lines
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Acked-by on v1 6/21
#11 lore raw

Re: [PATCH 06/21] arc: remove unnecessary prom.h includes

In reply to Rob Herring
Quoted 6 lines · Rob Herring

From: Rob Herring <rob.herring-bsGFqQB8/[email protected]>

Remove unnecessary prom.h includes in preparation to remove prom.h.

Cc Vineet Gupta <vgupta-HKixBCOQz3hWk0Htik3J/[email protected]>

Thx for the continued cleanup.
-Vineet
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#32 lore raw
In reply to Rob Herring
Quoted 12 lines · Rob Herring

From: Rob Herring <[email protected]>

This is the second series of clean-up for architecture DT code. The first series is here [1].

As the number of DT enabled architectures has grown, there has been a lot of copy/paste duplication of prom.h. The include ordering for prom.h is complex and has resulted in many implicit includes. This series cleans up prom.h and removes the dependency of prom.h includes in the core DT code on all architectures except sparc. This removes prom.h on several architectures and makes it an architecture specific include on the rest.

Quoted 7 lines

Compiled on arm, arm64, microblaze, mips, openrisc, powerpc, sparc, xtensa. Mostly defconfigs and some allyesconfigs. The 0-day builder has also caught some issues.

A branch with both series is available here:
git://sources.calxeda.com/kernel/linux.git dt-cleanup

I gave the latest branch a spin - everything looks good except for a build warning
- and given the const qualifier in the API, I reckon most (if not all) would see that.

It seems this was introduced in first series but maybe I failed to notice then as I'm sure I booted that code too.

------------------>8-----------------------------
CC arch/arc/kernel/devtree.o
arch/arc/kernel/devtree.c: In function ‘setup_machine_fdt’:
arch/arc/kernel/devtree.c:50:8: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]

  mdesc = of_flat_dt_match_machine(NULL, arch_get_next_mach);
        ^

------------------>8-----------------------------

ARM propagates the const to callers - upto setup_arch(), but that might not work for us as we use it to setup a global @machine_desc which is then used to dispatch the callbacks in platform APIs. Semantically it's good if it is const but that would require making it local and propagating to all the users - not worth the trouble I suppose.

What say you !

Thx,
-Vineet

Acked-by on v1 15/21
#23 lore raw

Re: [PATCH 15/21] of: remove HAVE_ARCH_DEVTREE_FIXUPS

In reply to Rob Herring
Quoted 9 lines · Rob Herring

From: Rob Herring <rob.herring-bsGFqQB8/[email protected]>

HAVE_ARCH_DEVTREE_FIXUPS appears to always be needed except for sparc, but it is only used for /proc/device-teee and sparc does not enable /proc/device-tree. So this option is redundant. Remove the option and always enable it. This has the side effect of fixing /proc/device-tree on arches such as arm64 which failed to define this option.

Thx for the continued cleanup.
-Vineet

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Acked-by on v1 21/21
#30 lore raw

Re: [PATCH 21/21] of: remove empty arch prom.h headers

In reply to Rob Herring
Quoted 5 lines · Rob Herring

From: Rob Herring <rob.herring-bsGFqQB8/[email protected]>

Now that prom.h is optional, all the empty prom.h headers can be removed.

Thx for the continued cleanup.
-Vineet

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer Acked-by on v1 4/21
#8 lore raw

Re: [PATCH 04/21] arm64: remove unnecessary prom.h include

In reply to Rob Herring
Quoted 7 lines · Rob Herring

From: Rob Herring <rob.herring-bsGFqQB8/[email protected]>

Remove unnecessary prom.h include in preparation to make prom.h optional.

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer Acked-by on v1 21/21
#31 lore raw

Re: [PATCH 21/21] of: remove empty arch prom.h headers

In reply to Rob Herring
Quoted 4 lines · Rob Herring

From: Rob Herring <rob.herring-bsGFqQB8/[email protected]>

Now that prom.h is optional, all the empty prom.h headers can be removed.

Quoted 10 lines
Cc Vineet Gupta <vgupta-HKixBCOQz3hWk0Htik3J/[email protected]>
Cc Catalin Marinas <[email protected]>
Cc Will Deacon <[email protected]>
Cc Mark Salter <[email protected]>
Cc Aurelien Jacquiot <[email protected]>
Cc James Hogan <[email protected]>
Cc Jonas Bonn <[email protected]>
Cc Chris Zankel <[email protected]>
Cc Max Filippov <[email protected]>

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw

Re: [PATCH 01/21] drivers: remove unnecessary prom.h includes

In reply to Rob Herring
Quoted 10 lines · Rob Herring

From: Rob Herring <rob.herring-bsGFqQB8/[email protected]>

Remove unnecessary prom.h includes in preparation to remove implicit includes of prom.h.

Applied to linux-can-next/testing, it will be included in my next pull request to David Miller.

tnx,
Marc

Signature · 4 lines
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |
#3 lore raw

Re: [PATCH 01/21] drivers: remove unnecessary prom.h includes

Quoted 6 lines · Marc Kleine-Budde
Quoted 5 lines · Rob Herring

From: Rob Herring <rob.herring-bsGFqQB8/[email protected]>

Remove unnecessary prom.h includes in preparation to remove implicit includes of prom.h.

Quoted 8 lines
Quoted 5 lines

Applied to linux-can-next/testing, it will be included in my next pull request to David Miller.

Please don't apply this. The whole series needs to be applied together. This patch is a dependency for the rest of the series.

Rob

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw

Re: [PATCH 01/21] drivers: remove unnecessary prom.h includes

Quoted 13 lines · Rob Herring
Quoted 12 lines · Marc Kleine-Budde
Quoted 10 lines · Rob Herring

From: Rob Herring <[email protected]>

Remove unnecessary prom.h includes in preparation to remove implicit includes of prom.h.

Quoted 5 lines
Quoted 2 lines

Applied to linux-can-next/testing, it will be included in my next pull request to David Miller.

Please don't apply this. The whole series needs to be applied together. This patch is a dependency for the rest of the series.

Okay, then add my Acked-by to this patch.

Marc

Signature · 4 lines
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |
Acked-by on v1 7/21
#13 lore raw

Re: [PATCH 07/21] hexagon: remove unnecessary prom.h includes

In reply to Rob Herring
Quoted 30 lines · Rob Herring

From: Rob Herring <[email protected]>

Hexagon does not have a prom.h header, so it is probably broken with CONFIG_OF enabled. In any case, remove unnecessary prom.h include in preparation to make prom.h optional.

---
 arch/hexagon/kernel/setup.c | 3 ---
 1 file changed, 3 deletions(-)
arch/hexagon/kernel/setup.c +0 -3
index 29d1f1b..0e7c1db 100644
@@ -32,9 +32,6 @@
 #include <asm/hexagon_vm.h>
 #include <asm/vm_mmu.h>
 #include <asm/time.h>
-#ifdef CONFIG_OF
-#include <asm/prom.h>
-#endif
 
 char cmd_line[COMMAND_LINE_SIZE];
 static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE;
Signature · 1 line
1.8.1.2
Signature · 3 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
#33 lore raw
In reply to Vineet Gupta

[Trimmed CC list a bit]

Quoted 35 lines · Vineet Gupta
Quoted 12 lines · Rob Herring

From: Rob Herring <rob.herring-bsGFqQB8/[email protected]>

This is the second series of clean-up for architecture DT code. The first series is here [1].

As the number of DT enabled architectures has grown, there has been a lot of copy/paste duplication of prom.h. The include ordering for prom.h is complex and has resulted in many implicit includes. This series cleans up prom.h and removes the dependency of prom.h includes in the core DT code on all architectures except sparc. This removes prom.h on several architectures and makes it an architecture specific include on the rest.

Quoted 7 lines

Compiled on arm, arm64, microblaze, mips, openrisc, powerpc, sparc, xtensa. Mostly defconfigs and some allyesconfigs. The 0-day builder has also caught some issues.

A branch with both series is available here:
git://sources.calxeda.com/kernel/linux.git dt-cleanup

I gave the latest branch a spin - everything looks good except for a build warning
- and given the const qualifier in the API, I reckon most (if not all) would see that.

It seems this was introduced in first series but maybe I failed to notice then as I'm sure I booted that code too.

------------------>8-----------------------------
CC arch/arc/kernel/devtree.o
arch/arc/kernel/devtree.c: In function ‘setup_machine_fdt’:
arch/arc/kernel/devtree.c:50:8: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]

  mdesc = of_flat_dt_match_machine(NULL, arch_get_next_mach);
        ^

------------------>8-----------------------------

Quoted 7 lines

ARM propagates the const to callers - upto setup_arch(), but that might not work for us as we use it to setup a global @machine_desc which is then used to dispatch the callbacks in platform APIs. Semantically it's good if it is const but that would require making it local and propagating to all the users - not worth the trouble I suppose.

What say you !

Ping ?

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#34 lore raw
Quoted 44 lines · Vineet Gupta

[Trimmed CC list a bit]

Quoted 41 lines · Vineet Gupta
Quoted 12 lines · Rob Herring

From: Rob Herring <rob.herring-bsGFqQB8/[email protected]>

This is the second series of clean-up for architecture DT code. The first series is here [1].

As the number of DT enabled architectures has grown, there has been a lot of copy/paste duplication of prom.h. The include ordering for prom.h is complex and has resulted in many implicit includes. This series cleans up prom.h and removes the dependency of prom.h includes in the core DT code on all architectures except sparc. This removes prom.h on several architectures and makes it an architecture specific include on the rest.

Quoted 7 lines

Compiled on arm, arm64, microblaze, mips, openrisc, powerpc, sparc, xtensa. Mostly defconfigs and some allyesconfigs. The 0-day builder has also caught some issues.

A branch with both series is available here:
git://sources.calxeda.com/kernel/linux.git dt-cleanup

I gave the latest branch a spin - everything looks good except for a build warning
- and given the const qualifier in the API, I reckon most (if not all) would see that.

It seems this was introduced in first series but maybe I failed to notice then as I'm sure I booted that code too.

------------------>8-----------------------------
CC arch/arc/kernel/devtree.o
arch/arc/kernel/devtree.c: In function ‘setup_machine_fdt’:
arch/arc/kernel/devtree.c:50:8: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]

  mdesc = of_flat_dt_match_machine(NULL, arch_get_next_mach);
        ^

------------------>8-----------------------------

ARM propagates the const to callers - upto setup_arch(), but that might not work for us as we use it to setup a global @machine_desc which is then used to dispatch the callbacks in platform APIs. Semantically it's good if it is const but that would require making it local and propagating to all the users - not worth the trouble I suppose.

Quoted 3 lines
Quoted 1 line

What say you !

Ping ?

I think this should be const like arm recently fixed. The structure is declared const with MACHINE_START which gets dropped.

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Acked-by on v1 14/21
#21 lore raw

Re: [PATCH 14/21] of: implement of_node_to_nid as a weak function

In reply to Rob Herring
Quoted 6 lines · Rob Herring

From: Rob Herring <[email protected]>

Implement of_node_to_nid as weak function to remove the dependency on asm/prom.h. This is in preparation to make prom.h optional.

Quoted 83 lines
---
 arch/powerpc/include/asm/prom.h |  7 -------
 arch/sparc/include/asm/prom.h   |  4 ----
 drivers/of/base.c               |  7 +++++++
 include/linux/of.h              | 11 ++++-------
 4 files changed, 11 insertions(+), 18 deletions(-)
arch/powerpc/include/asm/prom.h +0 -7
index bd215f7..6707c16 100644
@@ -42,13 +42,6 @@ extern void kdump_move_device_tree(void);
 /* cache lookup */
 struct device_node *of_find_next_cache_node(struct device_node *np);
 
-#ifdef CONFIG_NUMA
-extern int of_node_to_nid(struct device_node *device);
-#else
-static inline int of_node_to_nid(struct device_node *device) { return 0; }
-#endif
-#define of_node_to_nid of_node_to_nid
-
 extern void of_instantiate_rtc(void);
 
 extern int of_get_ibm_chip_id(struct device_node *np);
arch/sparc/include/asm/prom.h +0 -4
index 67c6257..60c8d7b 100644
@@ -43,10 +43,6 @@ extern int of_getintprop_default(struct device_node *np,
 				 const char *name,
 				 int def);
 extern int of_find_in_proplist(const char *list, const char *match, int len);
-#ifdef CONFIG_NUMA
-extern int of_node_to_nid(struct device_node *dp);
-#define of_node_to_nid of_node_to_nid
-#endif
 
 extern void prom_build_devicetree(void);
 extern void of_populate_present_mask(void);
drivers/of/base.c +7 -0
index 865d3f6..ced4c06 100644
@@ -74,6 +74,13 @@ int of_n_size_cells(struct device_node *np)
 }
 EXPORT_SYMBOL(of_n_size_cells);
 
+#ifdef CONFIG_NUMA
+int __weak of_node_to_nid(struct device_node *np)
+{
+	return numa_node_id();
+}
+#endif
+
 #if defined(CONFIG_OF_DYNAMIC)
 /**
  *	of_node_get - Increment refcount of a node
include/linux/of.h +4 -7
index f95aee3..4d294a0 100644
@@ -534,13 +534,10 @@ static inline const char *of_prop_next_string(struct property *prop,
 #define of_match_node(_matches, _node)	NULL
 #endif /* CONFIG_OF */
 
-#ifndef of_node_to_nid
-static inline int of_node_to_nid(struct device_node *np)
-{
-	return numa_node_id();
-}
-
-#define of_node_to_nid of_node_to_nid
+#if defined(CONFIG_OF) && defined(CONFIG_NUMA)
+extern int of_node_to_nid(struct device_node *np);
+#else
+static inline int of_node_to_nid(struct device_node *device) { return 0; }
 #endif
 
 /**
Signature · 1 line
1.8.1.2
Acked-by on the v1 series
#35 lore raw
In reply to Rob Herring
Quoted 12 lines · Rob Herring

From: Rob Herring <[email protected]>

This is the second series of clean-up for architecture DT code. The first series is here [1].

As the number of DT enabled architectures has grown, there has been a lot of copy/paste duplication of prom.h. The include ordering for prom.h is complex and has resulted in many implicit includes. This series cleans up prom.h and removes the dependency of prom.h includes in the core DT code on all architectures except sparc. This removes prom.h on several architectures and makes it an architecture specific include on the rest.

Quoted 6 lines

Compiled on arm, arm64, microblaze, mips, openrisc, powerpc, sparc, xtensa. Mostly defconfigs and some allyesconfigs. The 0-day builder has also caught some issues.

A branch with both series is available here:
git://sources.calxeda.com/kernel/linux.git dt-cleanup

Nice!

for the whole series.

g.

Quoted 129 lines

Rob

[1] http://www.spinics.net/lists/devicetree/msg04865.html

Rob Herring (21):
drivers: remove unnecessary prom.h includes
of: remove unnecessary prom.h includes
ARM: keystone: remove unnecessary prom.h include
arm64: remove unnecessary prom.h include
openrisc: remove unnecessary prom.h include
arc: remove unnecessary prom.h includes
hexagon: remove unnecessary prom.h includes
metag: move setup_machine_fdt declaration from prom.h
microblaze: clean-up prom.h implicit includes
drivers: clean-up prom.h implicit includes
mips: add explicit includes of prom.h
x86: add necessary includes for prom.h
of: implement pci_address_to_pio as weak function
of: implement of_node_to_nid as a weak function
of: remove HAVE_ARCH_DEVTREE_FIXUPS
of: move of_address_to_resource and of_iomap declarations from sparc
of: move of_translate_dma_address to of_address.h
powerpc: clean-up include ordering in prom.h
powerpc: add explicit OF includes
of: only include prom.h on sparc
of: remove empty arch prom.h headers

 arch/arc/include/asm/prom.h                      | 14 ---------
 arch/arc/kernel/devtree.c                        |  1 -
 arch/arc/kernel/setup.c                          |  1 -
 arch/arm/include/asm/prom.h                      |  2 --
 arch/arm/mach-keystone/platsmp.c                 |  1 -
 arch/arm64/include/asm/prom.h                    |  1 -
 arch/arm64/mm/init.c                             |  1 -
 arch/c6x/include/asm/prom.h                      |  1 -
 arch/hexagon/kernel/setup.c                      |  3 --
 arch/metag/include/asm/prom.h                    | 23 --------------
 arch/metag/include/asm/setup.h                   |  1 +
 arch/metag/kernel/setup.c                        |  1 -
 arch/microblaze/include/asm/prom.h               | 39 +-----------------------
 arch/microblaze/kernel/prom.c                    |  1 +
 arch/microblaze/kernel/setup.c                   |  1 +
 arch/microblaze/kernel/timer.c                   |  1 +
 arch/microblaze/pci/pci-common.c                 |  1 +
 arch/mips/include/asm/prom.h                     | 11 -------
 arch/mips/lantiq/prom.c                          |  1 +
 arch/mips/mti-sead3/sead3-setup.c                |  2 ++
 arch/mips/ralink/of.c                            |  1 +
 arch/openrisc/include/asm/prom.h                 | 22 -------------
 arch/openrisc/kernel/prom.c                      |  1 -
 arch/powerpc/include/asm/prom.h                  | 33 ++++----------------
 arch/powerpc/kernel/epapr_paravirt.c             |  1 +
 arch/powerpc/platforms/512x/clock.c              |  1 +
 arch/powerpc/platforms/512x/pdm360ng.c           |  2 ++
 arch/powerpc/platforms/82xx/mpc8272_ads.c        |  2 ++
 arch/powerpc/platforms/82xx/pq2fads.c            |  2 ++
 arch/powerpc/platforms/83xx/suspend.c            |  2 ++
 arch/powerpc/platforms/86xx/pic.c                |  1 +
 arch/powerpc/platforms/embedded6xx/flipper-pic.c |  1 +
 arch/powerpc/platforms/embedded6xx/hlwd-pic.c    |  2 ++
 arch/powerpc/platforms/pasemi/gpio_mdio.c        |  1 +
 arch/powerpc/platforms/powermac/pfunc_base.c     |  1 +
 arch/powerpc/platforms/powernv/opal-lpc.c        |  1 +
 arch/powerpc/platforms/powernv/opal.c            |  1 +
 arch/powerpc/platforms/powernv/setup.c           |  1 +
 arch/powerpc/platforms/pseries/hotplug-memory.c  |  2 ++
 arch/powerpc/sysdev/cpm_common.c                 |  1 +
 arch/powerpc/sysdev/fsl_gtm.c                    |  2 ++
 arch/powerpc/sysdev/fsl_pmc.c                    |  1 +
 arch/powerpc/sysdev/mpic.c                       |  8 ++---
 arch/powerpc/sysdev/mpic_timer.c                 |  2 ++
 arch/sparc/include/asm/prom.h                    | 12 --------
 arch/x86/include/asm/prom.h                      |  5 ---
 arch/x86/kernel/devicetree.c                     | 11 +------
 arch/xtensa/include/asm/prom.h                   |  6 ----
 drivers/ata/sata_fsl.c                           |  2 ++
 drivers/char/bsr.c                               |  1 +
 drivers/char/hw_random/pasemi-rng.c              |  1 +
 drivers/cpufreq/pasemi-cpufreq.c                 |  1 +
 drivers/crypto/caam/ctrl.c                       |  3 ++
 drivers/crypto/caam/jr.c                         |  2 ++
 drivers/dma/fsldma.c                             |  2 ++
 drivers/edac/cell_edac.c                         |  1 +
 drivers/i2c/busses/i2c-mpc.c                     |  2 ++
 drivers/i2c/busses/i2c-powermac.c                |  1 +
 drivers/input/serio/xilinx_ps2.c                 |  1 +
 drivers/macintosh/macio_asic.c                   |  2 ++
 drivers/macintosh/rack-meter.c                   |  2 ++
 drivers/macintosh/smu.c                          |  1 +
 drivers/macintosh/via-pmu.c                      |  2 ++
 drivers/mtd/nand/fsl_elbc_nand.c                 |  1 +
 drivers/mtd/nand/pasemi_nand.c                   |  2 ++
 drivers/net/can/grcan.c                          |  3 --
 drivers/net/can/sja1000/sja1000_of_platform.c    |  1 -
 drivers/net/ethernet/ibm/emac/core.c             |  2 ++
 drivers/net/ethernet/ibm/emac/mal.c              |  1 +
 drivers/net/ethernet/ibm/emac/rgmii.c            |  1 +
 drivers/net/ethernet/ibm/emac/tah.c              |  1 +
 drivers/net/ethernet/ibm/emac/zmii.c             |  1 +
 drivers/net/ethernet/xilinx/ll_temac_main.c      |  1 +
 drivers/of/address.c                             |  8 +++++
 drivers/of/base.c                                |  7 +++++
 drivers/of/of_pci.c                              |  1 -
 drivers/of/of_pci_irq.c                          |  1 -
 drivers/of/pdt.c                                 |  1 -
 drivers/pcmcia/electra_cf.c                      |  2 ++
 drivers/tty/ehv_bytechan.c                       |  1 +
 drivers/tty/serial/pmac_zilog.c                  |  2 ++
 drivers/usb/host/ehci-ppc-of.c                   |  2 ++
 drivers/usb/host/ohci-ppc-of.c                   |  2 ++
 fs/proc/proc_devtree.c                           |  3 --
 include/linux/of.h                               | 13 ++++----
 include/linux/of_address.h                       | 39 +++++++++++++-----------
 sound/aoa/core/gpio-feature.c                    |  3 +-
 sound/aoa/soundbus/i2sbus/core.c                 |  2 ++
 sound/ppc/pmac.c                                 |  2 ++
 sound/ppc/tumbler.c                              |  1 +
 90 files changed, 141 insertions(+), 220 deletions(-)
 delete mode 100644 arch/arc/include/asm/prom.h
 delete mode 100644 arch/arm64/include/asm/prom.h
 delete mode 100644 arch/c6x/include/asm/prom.h
 delete mode 100644 arch/metag/include/asm/prom.h
 delete mode 100644 arch/openrisc/include/asm/prom.h
 delete mode 100644 arch/xtensa/include/asm/prom.h
Signature · 1 line
1.8.1.2