aboutsummaryrefslogtreecommitdiffstats
path: root/arch/alpha/kernel
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2011-11-24 13:48:56 -0500
committerMichael S. Tsirkin <mst@redhat.com>2011-11-28 14:13:01 -0500
commitf2971c4c3197935f409bff202b9ab67416981dd7 (patch)
tree0e2b6ceb866324edd6d4034bff0b8be77b72a4b4 /arch/alpha/kernel
parent66eab4df288aaee75938ae99877c4f759fc6d56c (diff)
alpha: switch to GENERIC_PCI_IOMAP
alpha copied pci_iomap from generic code to avoid pulling the rest of iomap.c in. Since that's in a separate file now, we can reuse the common implementation. The only difference is handling of nocache flag, that turns out to be done correctly by the generic code since arch/alpha/include/asm/io.h defines ioremap_nocache same as ioremap. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'arch/alpha/kernel')
-rw-r--r--arch/alpha/kernel/pci.c26
1 files changed, 1 insertions, 25 deletions
diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c
index c9ab94ee1ca..f3cae275d3f 100644
--- a/arch/alpha/kernel/pci.c
+++ b/arch/alpha/kernel/pci.c
@@ -508,30 +508,7 @@ sys_pciconfig_iobase(long which, unsigned long bus, unsigned long dfn)
508 return -EOPNOTSUPP; 508 return -EOPNOTSUPP;
509} 509}
510 510
511/* Create an __iomem token from a PCI BAR. Copied from lib/iomap.c with 511/* Destroy an __iomem token. Not copied from lib/iomap.c. */
512 no changes, since we don't want the other things in that object file. */
513
514void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
515{
516 resource_size_t start = pci_resource_start(dev, bar);
517 resource_size_t len = pci_resource_len(dev, bar);
518 unsigned long flags = pci_resource_flags(dev, bar);
519
520 if (!len || !start)
521 return NULL;
522 if (maxlen && len > maxlen)
523 len = maxlen;
524 if (flags & IORESOURCE_IO)
525 return ioport_map(start, len);
526 if (flags & IORESOURCE_MEM) {
527 /* Not checking IORESOURCE_CACHEABLE because alpha does
528 not distinguish between ioremap and ioremap_nocache. */
529 return ioremap(start, len);
530 }
531 return NULL;
532}
533
534/* Destroy that token. Not copied from lib/iomap.c. */
535 512
536void pci_iounmap(struct pci_dev *dev, void __iomem * addr) 513void pci_iounmap(struct pci_dev *dev, void __iomem * addr)
537{ 514{
@@ -539,7 +516,6 @@ void pci_iounmap(struct pci_dev *dev, void __iomem * addr)
539 iounmap(addr); 516 iounmap(addr);
540} 517}
541 518
542EXPORT_SYMBOL(pci_iomap);
543EXPORT_SYMBOL(pci_iounmap); 519EXPORT_SYMBOL(pci_iounmap);
544 520
545/* FIXME: Some boxes have multiple ISA bridges! */ 521/* FIXME: Some boxes have multiple ISA bridges! */