Skip to content

Commit 9caea00

Browse files
hdellertorvalds
authored andcommitted
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(). Link: https://lore.kernel.org/all/CAHk-=wjRrh98pZoQ+AzfWmsTZacWxTJKXZ9eKU2X_0+jM=O8nw@mail.gmail.com/ Signed-off-by: Helge Deller <[email protected]> Suggested-by: Linus Torvalds <[email protected]> Fixes: 97a29d5 ("[PARISC] fix compile break caused by iomap: make IOPORT/PCI mapping functions conditional") Cc: Arnd Bergmann <[email protected]> Cc: Guenter Roeck <[email protected]> Cc: Ulrich Teichert <[email protected]> Cc: James Bottomley <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 31ad37b commit 9caea00

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

arch/parisc/lib/iomap.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,12 +513,15 @@ void ioport_unmap(void __iomem *addr)
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);
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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,6 @@ static inline void __iomem *ioremap_np(phys_addr_t offset, size_t size)
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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ extern void __iomem *pci_iomap_range(struct pci_dev *dev, int bar,
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,
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 */

0 commit comments

Comments
 (0)