Skip to content

Commit 933c5a4

Browse files
stffrdhrnbjorn-helgaas
authored andcommitted
PCI: Stub __pci_ioport_map() for arches that don't support it at all
When building OpenRISC PCI, which has no ioport_map(), we get the following build error: lib/pci_iomap.c: In function 'pci_iomap_range': CC drivers/i2c/i2c-core-base.o ./include/asm-generic/pci_iomap.h:29:41: error: implicit declaration of function 'ioport_map'; did you mean 'ioremap'? [-Werror=implicit-function-declaration] 29 | #define __pci_ioport_map(dev, port, nr) ioport_map((port), (nr)) | ^~~~~~~~~~ lib/pci_iomap.c:44:24: note: in expansion of macro '__pci_ioport_map' 44 | return __pci_ioport_map(dev, start, len); | ^~~~~~~~~~~~~~~~ Add a NULL definition of __pci_ioport_map() for architectures that do not support ioport_map(). Suggested-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stafford Horne <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent d63ed7f commit 933c5a4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

include/asm-generic/pci_iomap.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
2525
#ifdef CONFIG_NO_GENERIC_PCI_IOPORT_MAP
2626
extern void __iomem *__pci_ioport_map(struct pci_dev *dev, unsigned long port,
2727
unsigned int nr);
28+
#elif !defined(CONFIG_HAS_IOPORT_MAP)
29+
#define __pci_ioport_map(dev, port, nr) NULL
2830
#else
2931
#define __pci_ioport_map(dev, port, nr) ioport_map((port), (nr))
3032
#endif

0 commit comments

Comments
 (0)