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
513 }513 }
514}514}
515 515
516#ifdef CONFIG_PCI
516void pci_iounmap(struct pci_dev *dev, void __iomem * addr)517void pci_iounmap(struct pci_dev *dev, void __iomem * addr)
517{518{
518 if (!INDIRECT_ADDR(addr)) {519 if (!INDIRECT_ADDR(addr)) {
519 iounmap(addr);520 iounmap(addr);
520 }521 }
521}522}
523EXPORT_SYMBOL(pci_iounmap);
524#endif
522 525
523EXPORT_SYMBOL(ioread8);526EXPORT_SYMBOL(ioread8);
524EXPORT_SYMBOL(ioread16);527EXPORT_SYMBOL(ioread16);
@@ -544,4 +547,3 @@ EXPORT_SYMBOL(iowrite16_rep); · 19 unmodified lines
544EXPORT_SYMBOL(iowrite32_rep);547EXPORT_SYMBOL(iowrite32_rep);
545EXPORT_SYMBOL(ioport_map);548EXPORT_SYMBOL(ioport_map);
546EXPORT_SYMBOL(ioport_unmap);549EXPORT_SYMBOL(ioport_unmap);
547EXPORT_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
110}110}
111#endif111#endif
112 112
113#ifdef CONFIG_PCI
114/* Destroy a virtual mapping cookie for a PCI BAR (memory or IO) */
115struct pci_dev;
116extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
117#elif defined(CONFIG_GENERIC_IOMAP)
118struct pci_dev;
119static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
120{ }
121#endif
122
123#include <asm-generic/pci_iomap.h>113#include <asm-generic/pci_iomap.h>
124 114
125#endif115#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
18extern void __iomem *pci_iomap_wc_range(struct pci_dev *dev, int bar,18extern void __iomem *pci_iomap_wc_range(struct pci_dev *dev, int bar,
19 unsigned long offset,19 unsigned long offset,
20 unsigned long maxlen);20 unsigned long maxlen);
21extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
21/* Create a virtual mapping cookie for a port on a given PCI device.22/* Create a virtual mapping cookie for a port on a given PCI device.
22 * Do not call this directly, it exists to make it easier for architectures23 * Do not call this directly, it exists to make it easier for architectures
23 * to override */24 * to override */
@@ -50,6 +51,8 @@ static inline void __iomem *pci_iomap_wc_range(struct pci_dev *dev, int bar, · 26 unmodified lines
50{51{
51 return NULL;52 return NULL;
52}53}
54static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
55{ }
53#endif56#endif
54 57
55#endif /* __ASM_GENERIC_PCI_IOMAP_H */58#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