diff options
author | Anton Vorontsov <avorontsov@ru.mvista.com> | 2008-06-10 18:31:00 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-06-30 08:30:51 -0400 |
commit | ff1f4ee94c3c4480b9cee95da2d19668262636c6 (patch) | |
tree | 004fd1b38a03ddd32a4e06134d67faa2d3d5019c /include | |
parent | 9a24729d8aeef967eac7af71c6a69edc83d06558 (diff) |
powerpc: Implement OF PCI address accessors stubs for CONFIG_PCI=n
To avoid "#ifdef CONFIG_PCI" in the drivers we should provide stubs in
place of OF PCI address accessors.
Without these stubs build breaks for drivers not strictly requiring PCI,
for example CONFIG_FB_OF=y without CONFIG_PCI:
LD .tmp_vmlinux1
drivers/built-in.o: In function `offb_map_reg':
offb.c:(.text+0x6e7c): undefined reference to `of_get_pci_address'
OF PCI IRQ accessors require pci_dev argument, so drivers using PCI
IRQs should depend on CONFIG_PCI anyway.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-powerpc/prom.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h index 78b7b0d494c0..eb3bd2e1c7f6 100644 --- a/include/asm-powerpc/prom.h +++ b/include/asm-powerpc/prom.h | |||
@@ -212,8 +212,16 @@ extern u64 of_translate_dma_address(struct device_node *dev, | |||
212 | */ | 212 | */ |
213 | extern const u32 *of_get_address(struct device_node *dev, int index, | 213 | extern const u32 *of_get_address(struct device_node *dev, int index, |
214 | u64 *size, unsigned int *flags); | 214 | u64 *size, unsigned int *flags); |
215 | #ifdef CONFIG_PCI | ||
215 | extern const u32 *of_get_pci_address(struct device_node *dev, int bar_no, | 216 | extern const u32 *of_get_pci_address(struct device_node *dev, int bar_no, |
216 | u64 *size, unsigned int *flags); | 217 | u64 *size, unsigned int *flags); |
218 | #else | ||
219 | static inline const u32 *of_get_pci_address(struct device_node *dev, | ||
220 | int bar_no, u64 *size, unsigned int *flags) | ||
221 | { | ||
222 | return NULL; | ||
223 | } | ||
224 | #endif /* CONFIG_PCI */ | ||
217 | 225 | ||
218 | /* Get an address as a resource. Note that if your address is | 226 | /* Get an address as a resource. Note that if your address is |
219 | * a PIO address, the conversion will fail if the physical address | 227 | * a PIO address, the conversion will fail if the physical address |
@@ -223,8 +231,16 @@ extern const u32 *of_get_pci_address(struct device_node *dev, int bar_no, | |||
223 | */ | 231 | */ |
224 | extern int of_address_to_resource(struct device_node *dev, int index, | 232 | extern int of_address_to_resource(struct device_node *dev, int index, |
225 | struct resource *r); | 233 | struct resource *r); |
234 | #ifdef CONFIG_PCI | ||
226 | extern int of_pci_address_to_resource(struct device_node *dev, int bar, | 235 | extern int of_pci_address_to_resource(struct device_node *dev, int bar, |
227 | struct resource *r); | 236 | struct resource *r); |
237 | #else | ||
238 | static inline int of_pci_address_to_resource(struct device_node *dev, int bar, | ||
239 | struct resource *r) | ||
240 | { | ||
241 | return -ENOSYS; | ||
242 | } | ||
243 | #endif /* CONFIG_PCI */ | ||
228 | 244 | ||
229 | /* Parse the ibm,dma-window property of an OF node into the busno, phys and | 245 | /* Parse the ibm,dma-window property of an OF node into the busno, phys and |
230 | * size parameters. | 246 | * size parameters. |