Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

of: implement pci_address_to_pio as weak function

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>

+9 -43
-9
arch/microblaze/include/asm/prom.h
··· 26 26 27 27 extern int of_early_console(void *version); 28 28 29 - /* 30 - * OF address retreival & translation 31 - */ 32 - 33 - #ifdef CONFIG_PCI 34 - extern unsigned long pci_address_to_pio(phys_addr_t address); 35 - #define pci_address_to_pio pci_address_to_pio 36 - #endif /* CONFIG_PCI */ 37 - 38 29 #endif /* _ASM_MICROBLAZE_PROM_H */
-11
arch/mips/include/asm/prom.h
··· 19 19 20 20 extern void device_tree_init(void); 21 21 22 - static inline unsigned long pci_address_to_pio(phys_addr_t address) 23 - { 24 - /* 25 - * The ioport address can be directly used by inX() / outX() 26 - */ 27 - BUG_ON(address > IO_SPACE_LIMIT); 28 - 29 - return (unsigned long) address; 30 - } 31 - #define pci_address_to_pio pci_address_to_pio 32 - 33 22 struct boot_param_header; 34 23 35 24 extern void __dt_setup_arch(struct boot_param_header *bph);
-5
arch/powerpc/include/asm/prom.h
··· 30 30 extern u64 of_translate_dma_address(struct device_node *dev, 31 31 const __be32 *in_addr); 32 32 33 - #ifdef CONFIG_PCI 34 - extern unsigned long pci_address_to_pio(phys_addr_t address); 35 - #define pci_address_to_pio pci_address_to_pio 36 - #endif /* CONFIG_PCI */ 37 - 38 33 /* Parse the ibm,dma-window property of an OF node into the busno, phys and 39 34 * size parameters. 40 35 */
-3
arch/x86/include/asm/prom.h
··· 39 39 40 40 extern char cmd_line[COMMAND_LINE_SIZE]; 41 41 42 - #define pci_address_to_pio pci_address_to_pio 43 - unsigned long pci_address_to_pio(phys_addr_t addr); 44 - 45 42 #define HAVE_ARCH_DEVTREE_FIXUPS 46 43 47 44 #endif /* __ASSEMBLY__ */
-10
arch/x86/kernel/devicetree.c
··· 27 27 28 28 int __initdata of_ioapic; 29 29 30 - unsigned long pci_address_to_pio(phys_addr_t address) 31 - { 32 - /* 33 - * The ioport address can be directly used by inX / outX 34 - */ 35 - BUG_ON(address >= (1 << 16)); 36 - return (unsigned long)address; 37 - } 38 - EXPORT_SYMBOL_GPL(pci_address_to_pio); 39 - 40 30 void __init early_init_dt_scan_chosen_arch(unsigned long node) 41 31 { 42 32 BUG();
+8
drivers/of/address.c
··· 626 626 } 627 627 EXPORT_SYMBOL(of_get_address); 628 628 629 + unsigned long __weak pci_address_to_pio(phys_addr_t address) 630 + { 631 + if (address > IO_SPACE_LIMIT) 632 + return (unsigned long)-1; 633 + 634 + return (unsigned long) address; 635 + } 636 + 629 637 static int __of_address_to_resource(struct device_node *dev, 630 638 const __be32 *addrp, u64 size, unsigned int flags, 631 639 const char *name, struct resource *r)
-1
drivers/of/of_pci.c
··· 2 2 #include <linux/export.h> 3 3 #include <linux/of.h> 4 4 #include <linux/of_pci.h> 5 - #include <asm/prom.h> 6 5 7 6 static inline int __of_pci_pci_compare(struct device_node *node, 8 7 unsigned int data)
+1 -4
include/linux/of_address.h
··· 52 52 extern const __be32 *of_get_address(struct device_node *dev, int index, 53 53 u64 *size, unsigned int *flags); 54 54 55 - #ifndef pci_address_to_pio 56 - static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; } 57 - #define pci_address_to_pio pci_address_to_pio 58 - #endif 55 + extern unsigned long pci_address_to_pio(phys_addr_t addr); 59 56 60 57 extern int of_pci_range_parser_init(struct of_pci_range_parser *parser, 61 58 struct device_node *node);