of: implement pci_address_to_pio as weak function
authorRob Herring <rob.herring@calxeda.com>
Sat, 7 Sep 2013 19:07:11 +0000 (14:07 -0500)
committerRob Herring <rob.herring@calxeda.com>
Thu, 10 Oct 2013 01:04:06 +0000 (20:04 -0500)
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.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Grant Likely <grant.likely@linaro.org>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: Grant Likely <grant.likely@linaro.org>
arch/microblaze/include/asm/prom.h
arch/mips/include/asm/prom.h
arch/powerpc/include/asm/prom.h
arch/x86/include/asm/prom.h
arch/x86/kernel/devicetree.c
drivers/of/address.c
drivers/of/of_pci.c
include/linux/of_address.h

index f05bedce70d07b4b4b8ef92afd6599a782560ff5..0ebd924902dfb23dfea7e3d1e006daf770e775cd 100644 (file)
@@ -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 */
index e3dbd0e0608eb726cc813c29de6f1ea430288139..ccd2b75f152cce2b1715d60df51af7b83020c1d1 100644 (file)
 
 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);
index 7d0c7f3a7171e98ce262ed4054c38af101032043..bd215f74df0f3e0dc8b678394a859d2e1be730fe 100644 (file)
 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.
  */
index bade6ac3b14fc881ee038f85a9fa3233c48f60b6..8ef2ec70858f79ece6db0227dc5e9e0bfef41a74 100644 (file)
@@ -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__ */
index 679d676a30d7a4508fee3a67ff90d72017265709..cffd0736854722d7da3ed179824d77181f64f47a 100644 (file)
@@ -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();
index b55c2189076064c1d9a8015079370046ad8ae615..556a7fb6ead3ae0dc49ebe42ae743b23752e4787 100644 (file)
@@ -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)
index e5ca00893c0c300979aec82a5fd764d1bde87192..848199633798cd635030b398c54f93e173de057d 100644 (file)
@@ -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)
index 4c2e6f26432cfe5b0260fecb0caa5a15601482e8..f6fc6899ceae76f402f6604f33a21925fe13c54d 100644 (file)
@@ -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);