aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-07-29 13:49:01 -0400
committerGrant Likely <grant.likely@secretlab.ca>2010-08-01 03:42:42 -0400
commit22ae782f86b726f9cea752c0f269ff6dcdf2f6e1 (patch)
tree9458a01b24d65fa2eab27ad5bdb2fa399b3c389f /arch/powerpc
parent12b15e83289bc7cf2ec9a342412e0c955beeb395 (diff)
of/address: Clean up function declarations
This patch moves the declaration of of_get_address(), of_get_pci_address(), and of_pci_address_to_resource() out of arch code and into the common linux/of_address header file. This patch also fixes some of the asm/prom.h ordering issues. It still includes some header files that it ideally shouldn't be, but at least the ordering is consistent now so that of_* overrides work. Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/include/asm/prom.h49
-rw-r--r--arch/powerpc/kernel/legacy_serial.c1
-rw-r--r--arch/powerpc/kernel/pci-common.c1
-rw-r--r--arch/powerpc/platforms/52xx/lite5200.c1
-rw-r--r--arch/powerpc/platforms/amigaone/setup.c3
-rw-r--r--arch/powerpc/platforms/iseries/mf.c1
-rw-r--r--arch/powerpc/platforms/powermac/feature.c2
-rw-r--r--arch/powerpc/sysdev/bestcomm/sram.c1
-rw-r--r--arch/powerpc/sysdev/fsl_gtm.c1
9 files changed, 21 insertions, 39 deletions
diff --git a/arch/powerpc/include/asm/prom.h b/arch/powerpc/include/asm/prom.h
index 55bccc0a21c3..ae26f2efd089 100644
--- a/arch/powerpc/include/asm/prom.h
+++ b/arch/powerpc/include/asm/prom.h
@@ -17,11 +17,6 @@
17 * 2 of the License, or (at your option) any later version. 17 * 2 of the License, or (at your option) any later version.
18 */ 18 */
19#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/of_fdt.h>
21#include <linux/of_address.h>
22#include <linux/of_irq.h>
23#include <linux/proc_fs.h>
24#include <linux/platform_device.h>
25#include <asm/irq.h> 20#include <asm/irq.h>
26#include <asm/atomic.h> 21#include <asm/atomic.h>
27 22
@@ -49,41 +44,9 @@ extern void pci_create_OF_bus_map(void);
49extern u64 of_translate_dma_address(struct device_node *dev, 44extern u64 of_translate_dma_address(struct device_node *dev,
50 const u32 *in_addr); 45 const u32 *in_addr);
51 46
52/* Extract an address from a device, returns the region size and
53 * the address space flags too. The PCI version uses a BAR number
54 * instead of an absolute index
55 */
56extern const u32 *of_get_address(struct device_node *dev, int index,
57 u64 *size, unsigned int *flags);
58#ifdef CONFIG_PCI
59extern const u32 *of_get_pci_address(struct device_node *dev, int bar_no,
60 u64 *size, unsigned int *flags);
61#else
62static inline const u32 *of_get_pci_address(struct device_node *dev,
63 int bar_no, u64 *size, unsigned int *flags)
64{
65 return NULL;
66}
67#endif /* CONFIG_PCI */
68
69#ifdef CONFIG_PCI
70extern int of_pci_address_to_resource(struct device_node *dev, int bar,
71 struct resource *r);
72#else
73static inline int of_pci_address_to_resource(struct device_node *dev, int bar,
74 struct resource *r)
75{
76 return -ENOSYS;
77}
78#endif /* CONFIG_PCI */
79
80#ifdef CONFIG_PCI 47#ifdef CONFIG_PCI
81extern unsigned long pci_address_to_pio(phys_addr_t address); 48extern unsigned long pci_address_to_pio(phys_addr_t address);
82#else 49#define pci_address_to_pio pci_address_to_pio
83static inline unsigned long pci_address_to_pio(phys_addr_t address)
84{
85 return (unsigned long)-1;
86}
87#endif /* CONFIG_PCI */ 50#endif /* CONFIG_PCI */
88 51
89/* Parse the ibm,dma-window property of an OF node into the busno, phys and 52/* Parse the ibm,dma-window property of an OF node into the busno, phys and
@@ -122,9 +85,19 @@ static inline int of_node_to_nid(struct device_node *device) { return 0; }
122 * resolving using the OF tree walking. 85 * resolving using the OF tree walking.
123 */ 86 */
124struct pci_dev; 87struct pci_dev;
88struct of_irq;
125extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq); 89extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq);
126 90
127extern void of_instantiate_rtc(void); 91extern void of_instantiate_rtc(void);
128 92
93/* These includes are put at the bottom because they may contain things
94 * that are overridden by this file. Ideally they shouldn't be included
95 * by this file, but there are a bunch of .c files that currently depend
96 * on it. Eventually they will be cleaned up. */
97#include <linux/of_fdt.h>
98#include <linux/of_address.h>
99#include <linux/of_irq.h>
100#include <linux/platform_device.h>
101
129#endif /* __KERNEL__ */ 102#endif /* __KERNEL__ */
130#endif /* _POWERPC_PROM_H */ 103#endif /* _POWERPC_PROM_H */
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c
index 035ada5443ee..c1fd0f9658fd 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -4,6 +4,7 @@
4#include <linux/serial_core.h> 4#include <linux/serial_core.h>
5#include <linux/console.h> 5#include <linux/console.h>
6#include <linux/pci.h> 6#include <linux/pci.h>
7#include <linux/of_address.h>
7#include <linux/of_device.h> 8#include <linux/of_device.h>
8#include <asm/io.h> 9#include <asm/io.h>
9#include <asm/mmu.h> 10#include <asm/mmu.h>
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 5b38f6ae2b29..9021c4ad4bbd 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -21,6 +21,7 @@
21#include <linux/string.h> 21#include <linux/string.h>
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/bootmem.h> 23#include <linux/bootmem.h>
24#include <linux/of_address.h>
24#include <linux/mm.h> 25#include <linux/mm.h>
25#include <linux/list.h> 26#include <linux/list.h>
26#include <linux/syscalls.h> 27#include <linux/syscalls.h>
diff --git a/arch/powerpc/platforms/52xx/lite5200.c b/arch/powerpc/platforms/52xx/lite5200.c
index 6d584f4e3c9a..de55bc0584b5 100644
--- a/arch/powerpc/platforms/52xx/lite5200.c
+++ b/arch/powerpc/platforms/52xx/lite5200.c
@@ -18,6 +18,7 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/pci.h> 19#include <linux/pci.h>
20#include <linux/of.h> 20#include <linux/of.h>
21#include <linux/of_address.h>
21#include <linux/root_dev.h> 22#include <linux/root_dev.h>
22#include <linux/initrd.h> 23#include <linux/initrd.h>
23#include <asm/time.h> 24#include <asm/time.h>
diff --git a/arch/powerpc/platforms/amigaone/setup.c b/arch/powerpc/platforms/amigaone/setup.c
index fb4eb0df054c..03aabc0e16ac 100644
--- a/arch/powerpc/platforms/amigaone/setup.c
+++ b/arch/powerpc/platforms/amigaone/setup.c
@@ -13,12 +13,13 @@
13 */ 13 */
14 14
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/of.h>
17#include <linux/of_address.h>
16#include <linux/seq_file.h> 18#include <linux/seq_file.h>
17#include <generated/utsrelease.h> 19#include <generated/utsrelease.h>
18 20
19#include <asm/machdep.h> 21#include <asm/machdep.h>
20#include <asm/cputable.h> 22#include <asm/cputable.h>
21#include <asm/prom.h>
22#include <asm/pci-bridge.h> 23#include <asm/pci-bridge.h>
23#include <asm/i8259.h> 24#include <asm/i8259.h>
24#include <asm/time.h> 25#include <asm/time.h>
diff --git a/arch/powerpc/platforms/iseries/mf.c b/arch/powerpc/platforms/iseries/mf.c
index d2c1d497846e..33e5fc7334fc 100644
--- a/arch/powerpc/platforms/iseries/mf.c
+++ b/arch/powerpc/platforms/iseries/mf.c
@@ -30,6 +30,7 @@
30#include <linux/init.h> 30#include <linux/init.h>
31#include <linux/completion.h> 31#include <linux/completion.h>
32#include <linux/delay.h> 32#include <linux/delay.h>
33#include <linux/proc_fs.h>
33#include <linux/dma-mapping.h> 34#include <linux/dma-mapping.h>
34#include <linux/bcd.h> 35#include <linux/bcd.h>
35#include <linux/rtc.h> 36#include <linux/rtc.h>
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c
index 9e1b9fd75206..75eec031e7a2 100644
--- a/arch/powerpc/platforms/powermac/feature.c
+++ b/arch/powerpc/platforms/powermac/feature.c
@@ -21,6 +21,8 @@
21#include <linux/delay.h> 21#include <linux/delay.h>
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <linux/sched.h> 23#include <linux/sched.h>
24#include <linux/of.h>
25#include <linux/of_address.h>
24#include <linux/spinlock.h> 26#include <linux/spinlock.h>
25#include <linux/adb.h> 27#include <linux/adb.h>
26#include <linux/pmu.h> 28#include <linux/pmu.h>
diff --git a/arch/powerpc/sysdev/bestcomm/sram.c b/arch/powerpc/sysdev/bestcomm/sram.c
index 5d74ef7a651f..1225012a681a 100644
--- a/arch/powerpc/sysdev/bestcomm/sram.c
+++ b/arch/powerpc/sysdev/bestcomm/sram.c
@@ -11,6 +11,7 @@
11 * kind, whether express or implied. 11 * kind, whether express or implied.
12 */ 12 */
13 13
14#include <linux/err.h>
14#include <linux/kernel.h> 15#include <linux/kernel.h>
15#include <linux/module.h> 16#include <linux/module.h>
16#include <linux/slab.h> 17#include <linux/slab.h>
diff --git a/arch/powerpc/sysdev/fsl_gtm.c b/arch/powerpc/sysdev/fsl_gtm.c
index eca4545dd52e..7dd2885321ad 100644
--- a/arch/powerpc/sysdev/fsl_gtm.c
+++ b/arch/powerpc/sysdev/fsl_gtm.c
@@ -14,6 +14,7 @@
14 */ 14 */
15 15
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/err.h>
17#include <linux/errno.h> 18#include <linux/errno.h>
18#include <linux/list.h> 19#include <linux/list.h>
19#include <linux/io.h> 20#include <linux/io.h>