aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2012-02-14 16:06:55 -0500
committerGrant Likely <grant.likely@secretlab.ca>2012-02-16 08:11:23 -0500
commita850a7554442f08d3e910c6eeb4ee216868dda1e (patch)
tree8ce5a44cda8074e1ca060ad4f2c0be99c9b79866 /include
parent1bc04f2cf8c2a1feadbd994f50c40bb145bf2989 (diff)
of/address: add empty static inlines for !CONFIG_OF
As the title says, this patch adds empty implementations for the address translation functions so that they can be used when CONFIG_OF is disabled. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Cc: Rob Herring <rob.herring@calxeda.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/of_address.h33
1 files changed, 29 insertions, 4 deletions
diff --git a/include/linux/of_address.h b/include/linux/of_address.h
index 3118623c2c1..01b925ad8d7 100644
--- a/include/linux/of_address.h
+++ b/include/linux/of_address.h
@@ -4,6 +4,7 @@
4#include <linux/errno.h> 4#include <linux/errno.h>
5#include <linux/of.h> 5#include <linux/of.h>
6 6
7#ifdef CONFIG_OF_ADDRESS
7extern u64 of_translate_address(struct device_node *np, const __be32 *addr); 8extern u64 of_translate_address(struct device_node *np, const __be32 *addr);
8extern int of_address_to_resource(struct device_node *dev, int index, 9extern int of_address_to_resource(struct device_node *dev, int index,
9 struct resource *r); 10 struct resource *r);
@@ -25,12 +26,37 @@ static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; }
25#define pci_address_to_pio pci_address_to_pio 26#define pci_address_to_pio pci_address_to_pio
26#endif 27#endif
27 28
28#ifdef CONFIG_PCI 29#else /* CONFIG_OF_ADDRESS */
30static inline int of_address_to_resource(struct device_node *dev, int index,
31 struct resource *r)
32{
33 return -EINVAL;
34}
35static inline struct device_node *of_find_matching_node_by_address(
36 struct device_node *from,
37 const struct of_device_id *matches,
38 u64 base_address)
39{
40 return NULL;
41}
42static inline void __iomem *of_iomap(struct device_node *device, int index)
43{
44 return NULL;
45}
46static inline const u32 *of_get_address(struct device_node *dev, int index,
47 u64 *size, unsigned int *flags)
48{
49 return NULL;
50}
51#endif /* CONFIG_OF_ADDRESS */
52
53
54#if defined(CONFIG_OF_ADDRESS) && defined(CONFIG_PCI)
29extern const __be32 *of_get_pci_address(struct device_node *dev, int bar_no, 55extern const __be32 *of_get_pci_address(struct device_node *dev, int bar_no,
30 u64 *size, unsigned int *flags); 56 u64 *size, unsigned int *flags);
31extern int of_pci_address_to_resource(struct device_node *dev, int bar, 57extern int of_pci_address_to_resource(struct device_node *dev, int bar,
32 struct resource *r); 58 struct resource *r);
33#else /* CONFIG_PCI */ 59#else /* CONFIG_OF_ADDRESS && CONFIG_PCI */
34static inline int of_pci_address_to_resource(struct device_node *dev, int bar, 60static inline int of_pci_address_to_resource(struct device_node *dev, int bar,
35 struct resource *r) 61 struct resource *r)
36{ 62{
@@ -42,8 +68,7 @@ static inline const __be32 *of_get_pci_address(struct device_node *dev,
42{ 68{
43 return NULL; 69 return NULL;
44} 70}
45#endif /* CONFIG_PCI */ 71#endif /* CONFIG_OF_ADDRESS && CONFIG_PCI */
46
47 72
48#endif /* __OF_ADDRESS_H */ 73#endif /* __OF_ADDRESS_H */
49 74