aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/of_address.h
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 /include/linux/of_address.h
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 'include/linux/of_address.h')
-rw-r--r--include/linux/of_address.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/linux/of_address.h b/include/linux/of_address.h
index cc567df9a00d..8aea06f0564c 100644
--- a/include/linux/of_address.h
+++ b/include/linux/of_address.h
@@ -8,5 +8,37 @@ extern int of_address_to_resource(struct device_node *dev, int index,
8 struct resource *r); 8 struct resource *r);
9extern void __iomem *of_iomap(struct device_node *device, int index); 9extern void __iomem *of_iomap(struct device_node *device, int index);
10 10
11/* Extract an address from a device, returns the region size and
12 * the address space flags too. The PCI version uses a BAR number
13 * instead of an absolute index
14 */
15extern const u32 *of_get_address(struct device_node *dev, int index,
16 u64 *size, unsigned int *flags);
17
18#ifndef pci_address_to_pio
19static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; }
20#define pci_address_to_pio pci_address_to_pio
21#endif
22
23#ifdef CONFIG_PCI
24extern const u32 *of_get_pci_address(struct device_node *dev, int bar_no,
25 u64 *size, unsigned int *flags);
26extern int of_pci_address_to_resource(struct device_node *dev, int bar,
27 struct resource *r);
28#else /* CONFIG_PCI */
29static inline int of_pci_address_to_resource(struct device_node *dev, int bar,
30 struct resource *r)
31{
32 return -ENOSYS;
33}
34
35static inline const u32 *of_get_pci_address(struct device_node *dev,
36 int bar_no, u64 *size, unsigned int *flags)
37{
38 return NULL;
39}
40#endif /* CONFIG_PCI */
41
42
11#endif /* __OF_ADDRESS_H */ 43#endif /* __OF_ADDRESS_H */
12 44