asm-generic: Support NO_IOPORT_MAP in pci_iomap.h
Subsystems (2)
PATCH 1/1 asm-generic: Support NO_IOPORT_MAP in pci_iomap.h
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);
| ^~~~~~~~~~~~~~~~
This patch adds a NULL definition of __pci_ioport_map for architetures which do not support ioport_map.
---
The Kconfig I am using to test this is here:
https://github.com/stffrdhrn/linux/commits/or1k-virt-4
include/asm-generic/pci_iomap.h | 2 ++ 1 file changed, 2 insertions(+)
include/asm-generic/pci_iomap.h +2 -0
@@ -25,6 +25,8 @@ extern void pci_iounmap(struct pci_dev *dev, void __iomem *);#ifdef CONFIG_NO_GENERIC_PCI_IOPORT_MAP extern void __iomem *__pci_ioport_map (struct pci_dev *dev,unsigned long port,unsigned int nr); +#elif !defined(CONFIG_HAS_IOPORT_MAP ) +#define __pci_ioport_map (dev, port, nr) NULL#else #define __pci_ioport_map (dev, port, nr) ioport_map((port), (nr))#endif
Signature · 1 line
2.36.1
Quoted 12 lines · Stafford Horne
When building OpenRISC PCI which has no
ioport_mapwe get the following build error.
lib/pci_iomap.c: In function 'pci_iomap_range':
CCdrivers/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);
| ^~~~~~~~~~~~~~~~
Quoted 5 lines
This patch adds a NULL definition of
__pci_ioport_mapfor architetures which do not supportioport_map.Suggested-by Arnd Bergmann <[email protected]>Signed-off-by Stafford Horne <[email protected]>
Appended to my pci/header-cleanup-immutable branch for v5.20, thanks!
Quoted 23 lines
---
TheKconfigI am using to test this is here:
https://github.com/stffrdhrn/linux/commits/or1k-virt-4include/asm-generic/pci_iomap.h | 2 ++ 1 file changed, 2 insertions(+)include/asm-generic/pci_iomap.h +2
-0@@ -25,6 +25,8 @@ extern void pci_iounmap(struct pci_dev *dev, void __iomem *);#ifdef CONFIG_NO_GENERIC_PCI_IOPORT_MAP extern void __iomem *__pci_ioport_map (struct pci_dev *dev,unsigned long port,unsigned int nr); +#elif !defined(CONFIG_HAS_IOPORT_MAP ) +#define __pci_ioport_map (dev, port, nr) NULL#else #define __pci_ioport_map (dev, port, nr) ioport_map((port), (nr))#endif Signature · 1 line
2.36.1
Quoted 13 lines · Bjorn Helgaas
Quoted 12 lines · Stafford Horne
When building OpenRISC PCI which has no
ioport_mapwe get the following build error.
lib/pci_iomap.c: In function 'pci_iomap_range':
CCdrivers/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);
| ^~~~~~~~~~~~~~~~
Quoted 7 lines
Quoted 5 lines
This patch adds a NULL definition of
__pci_ioport_mapfor architetures which do not supportioport_map.Suggested-by Arnd Bergmann <[email protected]>Signed-off-by Stafford Horne <[email protected]>Appended to my pci/header-cleanup-immutable branch for v5.20, thanks!
Thanks, I did have this in the PCI series on my OpenRISC fot-next branch. I will just rebase that on the pci/header-cleanup-immutable branch to avoid having the patch there two times.
Also, your updated subject on the commit is much better.
-Stafford
Quoted 23 lines
Quoted 23 lines
---
TheKconfigI am using to test this is here:
https://github.com/stffrdhrn/linux/commits/or1k-virt-4include/asm-generic/pci_iomap.h | 2 ++ 1 file changed, 2 insertions(+)include/asm-generic/pci_iomap.h +2
-0@@ -25,6 +25,8 @@ extern void pci_iounmap(struct pci_dev *dev, void __iomem *);#ifdef CONFIG_NO_GENERIC_PCI_IOPORT_MAP extern void __iomem *__pci_ioport_map (struct pci_dev *dev,unsigned long port,unsigned int nr); +#elif !defined(CONFIG_HAS_IOPORT_MAP ) +#define __pci_ioport_map (dev, port, nr) NULL#else #define __pci_ioport_map (dev, port, nr) ioport_map((port), (nr))#endif Signature · 1 line
2.36.1