diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-10 21:04:27 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-10 21:04:27 -0500 |
commit | e343a895a9f342f239c5e3c5ffc6c0b1707e6244 (patch) | |
tree | 46c81c6ae375b1f14e209b13c8ac020842807ece /arch/parisc | |
parent | 06792c4dde2ad143928cc95c1ba218c6269c494b (diff) | |
parent | 193a667fba76b3df482cbf865228e26ee246e889 (diff) |
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
lib: use generic pci_iomap on all architectures
Many architectures don't want to pull in iomap.c,
so they ended up duplicating pci_iomap from that file.
That function isn't trivial, and we are going to modify it
https://lkml.org/lkml/2011/11/14/183
so the duplication hurts.
This reduces the scope of the problem significantly,
by moving pci_iomap to a separate file and
referencing that from all architectures.
* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
alpha: drop pci_iomap/pci_iounmap from pci-noop.c
mn10300: switch to GENERIC_PCI_IOMAP
mn10300: add missing __iomap markers
frv: switch to GENERIC_PCI_IOMAP
tile: switch to GENERIC_PCI_IOMAP
tile: don't panic on iomap
sparc: switch to GENERIC_PCI_IOMAP
sh: switch to GENERIC_PCI_IOMAP
powerpc: switch to GENERIC_PCI_IOMAP
parisc: switch to GENERIC_PCI_IOMAP
mips: switch to GENERIC_PCI_IOMAP
microblaze: switch to GENERIC_PCI_IOMAP
arm: switch to GENERIC_PCI_IOMAP
alpha: switch to GENERIC_PCI_IOMAP
lib: add GENERIC_PCI_IOMAP
lib: move GENERIC_IOMAP to lib/Kconfig
Fix up trivial conflicts due to changes nearby in arch/{m68k,score}/Kconfig
Diffstat (limited to 'arch/parisc')
-rw-r--r-- | arch/parisc/Kconfig | 1 | ||||
-rw-r--r-- | arch/parisc/lib/iomap.c | 23 |
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) */ | ||
440 | void __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 | |||
461 | void pci_iounmap(struct pci_dev *dev, void __iomem * addr) | 439 | void 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); | |||
483 | EXPORT_SYMBOL(iowrite32_rep); | 461 | EXPORT_SYMBOL(iowrite32_rep); |
484 | EXPORT_SYMBOL(ioport_map); | 462 | EXPORT_SYMBOL(ioport_map); |
485 | EXPORT_SYMBOL(ioport_unmap); | 463 | EXPORT_SYMBOL(ioport_unmap); |
486 | EXPORT_SYMBOL(pci_iomap); | ||
487 | EXPORT_SYMBOL(pci_iounmap); | 464 | EXPORT_SYMBOL(pci_iounmap); |