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().
Unified · Split
| @@ -513,12 +513,15 @@ void ioport_unmap(void __iomem *addr) · 512 unmodified lines | |||
| 513 | } | 513 | } |
| 514 | } | 514 | } |
| 515 | 515 | ||
| 516 | #ifdef CONFIG_PCI | ||
| 516 | void pci_iounmap(struct pci_dev *dev, void __iomem * addr) | 517 | void 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 | } |
| 523 | EXPORT_SYMBOL(pci_iounmap); | ||
| 524 | #endif | ||
| 522 | 525 | ||
| 523 | EXPORT_SYMBOL(ioread8); | 526 | EXPORT_SYMBOL(ioread8); |
| 524 | EXPORT_SYMBOL(ioread16); | 527 | EXPORT_SYMBOL(ioread16); |
| @@ -544,4 +547,3 @@ EXPORT_SYMBOL(iowrite16_rep); · 19 unmodified lines | |||
| 544 | EXPORT_SYMBOL(iowrite32_rep); | 547 | EXPORT_SYMBOL(iowrite32_rep); |
| 545 | EXPORT_SYMBOL(ioport_map); | 548 | EXPORT_SYMBOL(ioport_map); |
| 546 | EXPORT_SYMBOL(ioport_unmap); | 549 | EXPORT_SYMBOL(ioport_unmap); |
| 547 | EXPORT_SYMBOL(pci_iounmap); | ||
| @@ -110,16 +110,6 @@ static inline void __iomem *ioremap_np(phys_addr_t offset, size_t size) · 109 unmodified lines | |||
| 110 | } | 110 | } |
| 111 | #endif | 111 | #endif |
| 112 | 112 | ||
| 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 | |||
| 123 | #include <asm-generic/pci_iomap.h> | 113 | #include <asm-generic/pci_iomap.h> |
| 124 | 114 | ||
| 125 | #endif | 115 | #endif |
| @@ -18,6 +18,7 @@ extern void __iomem *pci_iomap_range(struct pci_dev *dev, int bar, · 17 unmodified lines | |||
| 18 | extern void __iomem *pci_iomap_wc_range(struct pci_dev *dev, int bar, | 18 | extern 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); |
| 21 | extern 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 architectures | 23 | * 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 | } |
| 54 | static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr) | ||
| 55 | { } | ||
| 53 | #endif | 56 | #endif |
| 54 | 57 | ||
| 55 | #endif /* __ASM_GENERIC_PCI_IOMAP_H */ | 58 | #endif /* __ASM_GENERIC_PCI_IOMAP_H */ |