diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2011-11-24 14:10:12 -0500 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2011-11-28 14:13:22 -0500 |
commit | 43db595e8b5d78ce5ad2feab719814a76e3ad2e5 (patch) | |
tree | 927ca581da77c3044b0db3cb8fc9bfe3e8fef65f /arch/sh | |
parent | 335b8cf7c383c5589d29addd7c4149741a4014b9 (diff) |
sh: switch to GENERIC_PCI_IOMAP
sh 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/sh')
-rw-r--r-- | arch/sh/Kconfig | 1 | ||||
-rw-r--r-- | arch/sh/drivers/pci/pci.c | 23 |
2 files changed, 1 insertions, 23 deletions
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 5aeab58ac8be..ead164080cf5 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
@@ -857,6 +857,7 @@ config PCI | |||
857 | bool "PCI support" | 857 | bool "PCI support" |
858 | depends on SYS_SUPPORTS_PCI | 858 | depends on SYS_SUPPORTS_PCI |
859 | select PCI_DOMAINS | 859 | select PCI_DOMAINS |
860 | select GENERIC_PCI_IOMAP | ||
860 | help | 861 | help |
861 | Find out whether you have a PCI motherboard. PCI is the name of a | 862 | Find out whether you have a PCI motherboard. PCI is the name of a |
862 | bus system, i.e. the way the CPU talks to the other stuff inside | 863 | bus system, i.e. the way the CPU talks to the other stuff inside |
diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c index c2691afe8f79..11aaf2fdec84 100644 --- a/arch/sh/drivers/pci/pci.c +++ b/arch/sh/drivers/pci/pci.c | |||
@@ -393,29 +393,6 @@ static void __iomem *ioport_map_pci(struct pci_dev *dev, | |||
393 | return (void __iomem *)(chan->io_map_base + port); | 393 | return (void __iomem *)(chan->io_map_base + port); |
394 | } | 394 | } |
395 | 395 | ||
396 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) | ||
397 | { | ||
398 | resource_size_t start = pci_resource_start(dev, bar); | ||
399 | resource_size_t len = pci_resource_len(dev, bar); | ||
400 | unsigned long flags = pci_resource_flags(dev, bar); | ||
401 | |||
402 | if (unlikely(!len || !start)) | ||
403 | return NULL; | ||
404 | if (maxlen && len > maxlen) | ||
405 | len = maxlen; | ||
406 | |||
407 | if (flags & IORESOURCE_IO) | ||
408 | return ioport_map_pci(dev, start, len); | ||
409 | if (flags & IORESOURCE_MEM) { | ||
410 | if (flags & IORESOURCE_CACHEABLE) | ||
411 | return ioremap(start, len); | ||
412 | return ioremap_nocache(start, len); | ||
413 | } | ||
414 | |||
415 | return NULL; | ||
416 | } | ||
417 | EXPORT_SYMBOL(pci_iomap); | ||
418 | |||
419 | void pci_iounmap(struct pci_dev *dev, void __iomem *addr) | 396 | void pci_iounmap(struct pci_dev *dev, void __iomem *addr) |
420 | { | 397 | { |
421 | iounmap(addr); | 398 | iounmap(addr); |