aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2011-11-24 14:11:16 -0500
committerMichael S. Tsirkin <mst@redhat.com>2011-11-28 14:13:15 -0500
commit629a858160751b670e1376dab4788f0c84138cc6 (patch)
tree0cbaf0f5ac2d1c757a94f8e418df634e5a95e4de /arch
parenteab90291d35438bcebf7c3dc85be66d0f24e3002 (diff)
parisc: switch to GENERIC_PCI_IOMAP
parisc copied pci_iomap from generic code, probably to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/parisc/Kconfig1
-rw-r--r--arch/parisc/lib/iomap.c23
2 files changed, 1 insertions, 23 deletions
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index fdfd8be29e95..242a1b7ac759 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -14,6 +14,7 @@ config PARISC
14 select GENERIC_ATOMIC64 if !64BIT 14 select GENERIC_ATOMIC64 if !64BIT
15 select HAVE_GENERIC_HARDIRQS 15 select HAVE_GENERIC_HARDIRQS
16 select GENERIC_IRQ_PROBE 16 select GENERIC_IRQ_PROBE
17 select GENERIC_PCI_IOMAP
17 select IRQ_PER_CPU 18 select IRQ_PER_CPU
18 select ARCH_HAVE_NMI_SAFE_CMPXCHG 19 select ARCH_HAVE_NMI_SAFE_CMPXCHG
19 20
diff --git a/arch/parisc/lib/iomap.c b/arch/parisc/lib/iomap.c
index 8f470c93b16d..fb8e10a4fb39 100644
--- a/arch/parisc/lib/iomap.c
+++ b/arch/parisc/lib/iomap.c
@@ -436,28 +436,6 @@ void ioport_unmap(void __iomem *addr)
436 } 436 }
437} 437}
438 438
439/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
440void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
441{
442 resource_size_t start = pci_resource_start(dev, bar);
443 resource_size_t len = pci_resource_len(dev, bar);
444 unsigned long flags = pci_resource_flags(dev, bar);
445
446 if (!len || !start)
447 return NULL;
448 if (maxlen && len > maxlen)
449 len = maxlen;
450 if (flags & IORESOURCE_IO)
451 return ioport_map(start, len);
452 if (flags & IORESOURCE_MEM) {
453 if (flags & IORESOURCE_CACHEABLE)
454 return ioremap(start, len);
455 return ioremap_nocache(start, len);
456 }
457 /* What? */
458 return NULL;
459}
460
461void pci_iounmap(struct pci_dev *dev, void __iomem * addr) 439void pci_iounmap(struct pci_dev *dev, void __iomem * addr)
462{ 440{
463 if (!INDIRECT_ADDR(addr)) { 441 if (!INDIRECT_ADDR(addr)) {
@@ -483,5 +461,4 @@ EXPORT_SYMBOL(iowrite16_rep);
483EXPORT_SYMBOL(iowrite32_rep); 461EXPORT_SYMBOL(iowrite32_rep);
484EXPORT_SYMBOL(ioport_map); 462EXPORT_SYMBOL(ioport_map);
485EXPORT_SYMBOL(ioport_unmap); 463EXPORT_SYMBOL(ioport_unmap);
486EXPORT_SYMBOL(pci_iomap);
487EXPORT_SYMBOL(pci_iounmap); 464EXPORT_SYMBOL(pci_iounmap);