aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2012-01-29 17:20:48 -0500
committerMichael S. Tsirkin <mst@redhat.com>2012-01-31 16:19:47 -0500
commitb923650b84068b74b6df838aa8f9b2a350171de6 (patch)
treed6d366da5427816210dc15c7c401e4a7910092c4 /lib
parent0a9626575400879d1d5e6bc8768188b938d7c501 (diff)
lib: add NO_GENERIC_PCI_IOPORT_MAP
Some architectures need to override the way IO port mapping is done on PCI devices. Supply a generic macro that calls ioport_map, and make it possible for architectures to override. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/Kconfig3
-rw-r--r--lib/pci_iomap.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/Kconfig b/lib/Kconfig
index 169eb7c598e..1df13883481 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -19,6 +19,9 @@ config RATIONAL
19config GENERIC_FIND_FIRST_BIT 19config GENERIC_FIND_FIRST_BIT
20 bool 20 bool
21 21
22config NO_GENERIC_PCI_IOPORT_MAP
23 bool
24
22config GENERIC_PCI_IOMAP 25config GENERIC_PCI_IOMAP
23 bool 26 bool
24 27
diff --git a/lib/pci_iomap.c b/lib/pci_iomap.c
index 4b0fdc22e68..0d83ea8a960 100644
--- a/lib/pci_iomap.c
+++ b/lib/pci_iomap.c
@@ -34,7 +34,7 @@ void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
34 if (maxlen && len > maxlen) 34 if (maxlen && len > maxlen)
35 len = maxlen; 35 len = maxlen;
36 if (flags & IORESOURCE_IO) 36 if (flags & IORESOURCE_IO)
37 return ioport_map(start, len); 37 return __pci_ioport_map(dev, start, len);
38 if (flags & IORESOURCE_MEM) { 38 if (flags & IORESOURCE_MEM) {
39 if (flags & IORESOURCE_CACHEABLE) 39 if (flags & IORESOURCE_CACHEABLE)
40 return ioremap(start, len); 40 return ioremap(start, len);