diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2011-11-24 13:48:56 -0500 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2011-11-28 14:13:01 -0500 |
commit | f2971c4c3197935f409bff202b9ab67416981dd7 (patch) | |
tree | 0e2b6ceb866324edd6d4034bff0b8be77b72a4b4 /arch/alpha | |
parent | 66eab4df288aaee75938ae99877c4f759fc6d56c (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')
-rw-r--r-- | arch/alpha/Kconfig | 1 | ||||
-rw-r--r-- | arch/alpha/kernel/pci.c | 26 |
2 files changed, 2 insertions, 25 deletions
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index 3636b11ddff0..56a4df952fb0 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig | |||
@@ -315,6 +315,7 @@ config ISA_DMA_API | |||
315 | config PCI | 315 | config PCI |
316 | bool | 316 | bool |
317 | depends on !ALPHA_JENSEN | 317 | depends on !ALPHA_JENSEN |
318 | select GENERIC_PCI_IOMAP | ||
318 | default y | 319 | default y |
319 | help | 320 | help |
320 | Find out whether you have a PCI motherboard. PCI is the name of a | 321 | Find out whether you have a PCI motherboard. PCI is the name of a |
diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c index c9ab94ee1ca8..f3cae275d3f5 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 | |||
514 | void __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 | ||
536 | void pci_iounmap(struct pci_dev *dev, void __iomem * addr) | 513 | void 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 | ||
542 | EXPORT_SYMBOL(pci_iomap); | ||
543 | EXPORT_SYMBOL(pci_iounmap); | 519 | EXPORT_SYMBOL(pci_iounmap); |
544 | 520 | ||
545 | /* FIXME: Some boxes have multiple ISA bridges! */ | 521 | /* FIXME: Some boxes have multiple ISA bridges! */ |