diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2011-11-24 14:10:12 -0500 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2011-12-04 08:59:49 -0500 |
commit | a21a2fd4036f9a572415a7543896a1163c211ee5 (patch) | |
tree | e668585f82aee3abb56b011c78cdb7a5f46099da /arch/sparc/lib | |
parent | 43db595e8b5d78ce5ad2feab719814a76e3ad2e5 (diff) |
sparc: switch to GENERIC_PCI_IOMAP
sparc 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/sparc/lib')
-rw-r--r-- | arch/sparc/lib/iomap.c | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/arch/sparc/lib/iomap.c b/arch/sparc/lib/iomap.c index 9ef37e13a920..c4d42a50ebc0 100644 --- a/arch/sparc/lib/iomap.c +++ b/arch/sparc/lib/iomap.c | |||
@@ -18,31 +18,8 @@ void ioport_unmap(void __iomem *addr) | |||
18 | EXPORT_SYMBOL(ioport_map); | 18 | EXPORT_SYMBOL(ioport_map); |
19 | EXPORT_SYMBOL(ioport_unmap); | 19 | EXPORT_SYMBOL(ioport_unmap); |
20 | 20 | ||
21 | /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ | ||
22 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) | ||
23 | { | ||
24 | resource_size_t start = pci_resource_start(dev, bar); | ||
25 | resource_size_t len = pci_resource_len(dev, bar); | ||
26 | unsigned long flags = pci_resource_flags(dev, bar); | ||
27 | |||
28 | if (!len || !start) | ||
29 | return NULL; | ||
30 | if (maxlen && len > maxlen) | ||
31 | len = maxlen; | ||
32 | if (flags & IORESOURCE_IO) | ||
33 | return ioport_map(start, len); | ||
34 | if (flags & IORESOURCE_MEM) { | ||
35 | if (flags & IORESOURCE_CACHEABLE) | ||
36 | return ioremap(start, len); | ||
37 | return ioremap_nocache(start, len); | ||
38 | } | ||
39 | /* What? */ | ||
40 | return NULL; | ||
41 | } | ||
42 | |||
43 | void pci_iounmap(struct pci_dev *dev, void __iomem * addr) | 21 | void pci_iounmap(struct pci_dev *dev, void __iomem * addr) |
44 | { | 22 | { |
45 | /* nothing to do */ | 23 | /* nothing to do */ |
46 | } | 24 | } |
47 | EXPORT_SYMBOL(pci_iomap); | ||
48 | EXPORT_SYMBOL(pci_iounmap); | 25 | EXPORT_SYMBOL(pci_iounmap); |