Commit 82ed223c264def2b15ee4bec2e8c3048092ceb5f

Authored by Jonas Bonn
1 parent f1ecc69838

iomap: make IOPORT/PCI mapping functions conditional

Use the CONFIG_HAS_IOPORT and CONFIG_PCI options to decide whether or
not functions for mapping these areas are provided.

Signed-off-by: Jonas Bonn <jonas@southpole.se>
Acked-by: Arnd Bergmann <arnd@arndb.de>

Showing 3 changed files with 10 additions and 0 deletions Side-by-side Diff

include/asm-generic/io.h
... ... @@ -332,6 +332,7 @@
332 332 }
333 333 #endif /* CONFIG_MMU */
334 334  
  335 +#ifdef CONFIG_HAS_IOPORT
335 336 #ifndef CONFIG_GENERIC_IOMAP
336 337 static inline void __iomem *ioport_map(unsigned long port, unsigned int nr)
337 338 {
... ... @@ -345,6 +346,7 @@
345 346 extern void __iomem *ioport_map(unsigned long port, unsigned int nr);
346 347 extern void ioport_unmap(void __iomem *p);
347 348 #endif /* CONFIG_GENERIC_IOMAP */
  349 +#endif /* CONFIG_HAS_IOPORT */
348 350  
349 351 #define xlate_dev_kmem_ptr(p) p
350 352 #define xlate_dev_mem_ptr(p) __va(p)
include/asm-generic/iomap.h
... ... @@ -56,18 +56,22 @@
56 56 extern void iowrite16_rep(void __iomem *port, const void *buf, unsigned long count);
57 57 extern void iowrite32_rep(void __iomem *port, const void *buf, unsigned long count);
58 58  
  59 +#ifdef CONFIG_HAS_IOPORT
59 60 /* Create a virtual mapping cookie for an IO port range */
60 61 extern void __iomem *ioport_map(unsigned long port, unsigned int nr);
61 62 extern void ioport_unmap(void __iomem *);
  63 +#endif
62 64  
63 65 #ifndef ARCH_HAS_IOREMAP_WC
64 66 #define ioremap_wc ioremap_nocache
65 67 #endif
66 68  
  69 +#ifdef CONFIG_PCI
67 70 /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
68 71 struct pci_dev;
69 72 extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
70 73 extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
  74 +#endif
71 75  
72 76 #endif
... ... @@ -224,6 +224,7 @@
224 224 EXPORT_SYMBOL(iowrite16_rep);
225 225 EXPORT_SYMBOL(iowrite32_rep);
226 226  
  227 +#ifdef CONFIG_HAS_IOPORT
227 228 /* Create a virtual mapping cookie for an IO port range */
228 229 void __iomem *ioport_map(unsigned long port, unsigned int nr)
229 230 {
230 231  
... ... @@ -238,7 +239,9 @@
238 239 }
239 240 EXPORT_SYMBOL(ioport_map);
240 241 EXPORT_SYMBOL(ioport_unmap);
  242 +#endif /* CONFIG_HAS_IOPORT */
241 243  
  244 +#ifdef CONFIG_PCI
242 245 /**
243 246 * pci_iomap - create a virtual mapping cookie for a PCI BAR
244 247 * @dev: PCI device that owns the BAR
... ... @@ -280,4 +283,5 @@
280 283 }
281 284 EXPORT_SYMBOL(pci_iomap);
282 285 EXPORT_SYMBOL(pci_iounmap);
  286 +#endif /* CONFIG_PCI */