Skip to content

Commit 25ff794

Browse files
author
Rob Herring
committed
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>
1 parent ba904f0 commit 25ff794

8 files changed

Lines changed: 9 additions & 43 deletions

File tree

‎arch/microblaze/include/asm/prom.h‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,4 @@ enum early_consoles {
2626

2727
extern int of_early_console(void *version);
2828

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-
3829
#endif /* _ASM_MICROBLAZE_PROM_H */

‎arch/mips/include/asm/prom.h‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,6 @@
1919

2020
extern void device_tree_init(void);
2121

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-
3322
struct boot_param_header;
3423

3524
extern void __dt_setup_arch(struct boot_param_header *bph);

‎arch/powerpc/include/asm/prom.h‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@
3030
extern u64 of_translate_dma_address(struct device_node *dev,
3131
const __be32 *in_addr);
3232

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-
3833
/* Parse the ibm,dma-window property of an OF node into the busno, phys and
3934
* size parameters.
4035
*/

‎arch/x86/include/asm/prom.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ static inline void x86_dtb_init(void) { }
3939

4040
extern char cmd_line[COMMAND_LINE_SIZE];
4141

42-
#define pci_address_to_pio pci_address_to_pio
43-
unsigned long pci_address_to_pio(phys_addr_t addr);
44-
4542
#define HAVE_ARCH_DEVTREE_FIXUPS
4643

4744
#endif /* __ASSEMBLY__ */

‎arch/x86/kernel/devicetree.c‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,6 @@ char __initdata cmd_line[COMMAND_LINE_SIZE];
2727

2828
int __initdata of_ioapic;
2929

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-
4030
void __init early_init_dt_scan_chosen_arch(unsigned long node)
4131
{
4232
BUG();

‎drivers/of/address.c‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,14 @@ const __be32 *of_get_address(struct device_node *dev, int index, u64 *size,
626626
}
627627
EXPORT_SYMBOL(of_get_address);
628628

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+
629637
static int __of_address_to_resource(struct device_node *dev,
630638
const __be32 *addrp, u64 size, unsigned int flags,
631639
const char *name, struct resource *r)

‎drivers/of/of_pci.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#include <linux/export.h>
33
#include <linux/of.h>
44
#include <linux/of_pci.h>
5-
#include <asm/prom.h>
65

76
static inline int __of_pci_pci_compare(struct device_node *node,
87
unsigned int data)

‎include/linux/of_address.h‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,7 @@ extern void __iomem *of_iomap(struct device_node *device, int index);
5252
extern const __be32 *of_get_address(struct device_node *dev, int index,
5353
u64 *size, unsigned int *flags);
5454

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);
5956

6057
extern int of_pci_range_parser_init(struct of_pci_range_parser *parser,
6158
struct device_node *node);

0 commit comments

Comments
 (0)