History

parisc: Declare pci_iounmap() parisc version only when CONFIG_PCI enabled

Linus noticed odd declaration rules for pci_iounmap() in iomap.h and pci_iomap.h, where it dependend on either NO_GENERIC_PCI_IOPORT_MAP or GENERIC_IOMAP when CONFIG_PCI was disabled. Testing on parisc seems to indicate that we need pci_iounmap() only when CONFIG_PCI is enabled, so the declaration of pci_iounmap() can be moved cleanly into pci_iomap.h in sync with the declarations of pci_iomap().

Helge Deller committed 5 years ago

Commit 9caea001 parent 31ad37b3 files · +6 −11Browse files

Unified · Split

3 files
  1. arch/parisc/lib/iomap.c +3 −1
  2. include/asm-generic/iomap.h +0 −10
  3. include/asm-generic/pci_iomap.h +3 −0
arch/parisc/lib/iomap.c+3−1
@@ -513,12 +513,15 @@ void ioport_unmap(void __iomem *addr) · 512 unmodified lines
513513 }
514514 }
515515
516+#ifdef CONFIG_PCI
516517 void pci_iounmap(struct pci_dev *dev, void __iomem * addr)
517518 {
518519 if (!INDIRECT_ADDR(addr)) {
519520 iounmap(addr);
520521 }
521522 }
523+EXPORT_SYMBOL(pci_iounmap);
524+#endif
522525
523526 EXPORT_SYMBOL(ioread8);
524527 EXPORT_SYMBOL(ioread16);
@@ -544,4 +547,3 @@ EXPORT_SYMBOL(iowrite16_rep); · 19 unmodified lines
544547 EXPORT_SYMBOL(iowrite32_rep);
545548 EXPORT_SYMBOL(ioport_map);
546549 EXPORT_SYMBOL(ioport_unmap);
547−EXPORT_SYMBOL(pci_iounmap);
include/asm-generic/iomap.h+0−10
@@ -110,16 +110,6 @@ static inline void __iomem *ioremap_np(phys_addr_t offset, size_t size) · 109 unmodified lines
110110 }
111111 #endif
112112
113−#ifdef CONFIG_PCI
114−/* Destroy a virtual mapping cookie for a PCI BAR (memory or IO) */
115−struct pci_dev;
116−extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
117−#elif defined(CONFIG_GENERIC_IOMAP)
118−struct pci_dev;
119−static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
120−{ }
121−#endif
122−
123113 #include <asm-generic/pci_iomap.h>
124114
125115 #endif
include/asm-generic/pci_iomap.h+3−0
@@ -18,6 +18,7 @@ extern void __iomem *pci_iomap_range(struct pci_dev *dev, int bar, · 17 unmodified lines
1818 extern void __iomem *pci_iomap_wc_range(struct pci_dev *dev, int bar,
1919 unsigned long offset,
2020 unsigned long maxlen);
21+extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
2122 /* Create a virtual mapping cookie for a port on a given PCI device.
2223 * Do not call this directly, it exists to make it easier for architectures
2324 * to override */
@@ -50,6 +51,8 @@ static inline void __iomem *pci_iomap_wc_range(struct pci_dev *dev, int bar, · 26 unmodified lines
5051 {
5152 return NULL;
5253 }
54+static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
55+{ }
5356 #endif
5457
5558 #endif /* __ASM_GENERIC_PCI_IOMAP_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t