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:13 -0500 |
commit | eab90291d35438bcebf7c3dc85be66d0f24e3002 (patch) | |
tree | 60077b6ad11afa0c7d6b70b12e259b33be718210 /arch | |
parent | 1b34d16073430671513b5231fb81cbe725b1a0de (diff) |
mips: switch to GENERIC_PCI_IOMAP
mips 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/mips/Kconfig | 1 | ||||
-rw-r--r-- | arch/mips/lib/iomap-pci.c | 26 |
2 files changed, 1 insertions, 26 deletions
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index d46f1da18a3c..b70c96f4417e 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -2317,6 +2317,7 @@ config PCI | |||
2317 | bool "Support for PCI controller" | 2317 | bool "Support for PCI controller" |
2318 | depends on HW_HAS_PCI | 2318 | depends on HW_HAS_PCI |
2319 | select PCI_DOMAINS | 2319 | select PCI_DOMAINS |
2320 | select GENERIC_PCI_IOMAP | ||
2320 | help | 2321 | help |
2321 | Find out whether you have a PCI motherboard. PCI is the name of a | 2322 | Find out whether you have a PCI motherboard. PCI is the name of a |
2322 | bus system, i.e. the way the CPU talks to the other stuff inside | 2323 | bus system, i.e. the way the CPU talks to the other stuff inside |
diff --git a/arch/mips/lib/iomap-pci.c b/arch/mips/lib/iomap-pci.c index 2ab899c4b4ce..2635b1a96333 100644 --- a/arch/mips/lib/iomap-pci.c +++ b/arch/mips/lib/iomap-pci.c | |||
@@ -40,32 +40,6 @@ static void __iomem *ioport_map_pci(struct pci_dev *dev, | |||
40 | return (void __iomem *) (ctrl->io_map_base + port); | 40 | return (void __iomem *) (ctrl->io_map_base + port); |
41 | } | 41 | } |
42 | 42 | ||
43 | /* | ||
44 | * Create a virtual mapping cookie for a PCI BAR (memory or IO) | ||
45 | */ | ||
46 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) | ||
47 | { | ||
48 | resource_size_t start = pci_resource_start(dev, bar); | ||
49 | resource_size_t len = pci_resource_len(dev, bar); | ||
50 | unsigned long flags = pci_resource_flags(dev, bar); | ||
51 | |||
52 | if (!len || !start) | ||
53 | return NULL; | ||
54 | if (maxlen && len > maxlen) | ||
55 | len = maxlen; | ||
56 | if (flags & IORESOURCE_IO) | ||
57 | return ioport_map_pci(dev, start, len); | ||
58 | if (flags & IORESOURCE_MEM) { | ||
59 | if (flags & IORESOURCE_CACHEABLE) | ||
60 | return ioremap(start, len); | ||
61 | return ioremap_nocache(start, len); | ||
62 | } | ||
63 | /* What? */ | ||
64 | return NULL; | ||
65 | } | ||
66 | |||
67 | EXPORT_SYMBOL(pci_iomap); | ||
68 | |||
69 | void pci_iounmap(struct pci_dev *dev, void __iomem * addr) | 43 | void pci_iounmap(struct pci_dev *dev, void __iomem * addr) |
70 | { | 44 | { |
71 | iounmap(addr); | 45 | iounmap(addr); |