]> Pileus Git - ~andy/linux/commitdiff
sparc: switch to GENERIC_PCI_IOMAP
authorMichael S. Tsirkin <mst@redhat.com>
Thu, 24 Nov 2011 19:10:12 +0000 (21:10 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 4 Dec 2011 13:59:49 +0000 (15:59 +0200)
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>
arch/sparc/Kconfig
arch/sparc/include/asm/io_32.h
arch/sparc/include/asm/io_64.h
arch/sparc/lib/iomap.c

index f92602e86607cb094f04ead294b8a3d6f6decdcf..a4644f5ea98c97b91eac9748a06ba0c6bee25d53 100644 (file)
@@ -28,6 +28,7 @@ config SPARC
        select HAVE_GENERIC_HARDIRQS
        select GENERIC_IRQ_SHOW
        select USE_GENERIC_SMP_HELPERS if SMP
+       select GENERIC_PCI_IOMAP
 
 config SPARC32
        def_bool !64BIT
index c2ced21c9dc19a7c284960d6a180f30345e5120f..2006e5d359dfb5f602ab004208ea60d610e15a6d 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <asm/page.h>      /* IO address mapping routines need this */
 #include <asm/system.h>
+#include <asm-generic/pci_iomap.h>
 
 #define page_to_phys(page)     (page_to_pfn(page) << PAGE_SHIFT)
 
@@ -324,7 +325,6 @@ extern void ioport_unmap(void __iomem *);
 
 /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
 struct pci_dev;
-extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
 extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
 
 /*
index 9c8965415f0a5187cd550435341029f553bdbfe2..9481e5a6fa90e218ffa2124a0feef91ffd228b4a 100644 (file)
@@ -8,6 +8,7 @@
 #include <asm/page.h>      /* IO address mapping routines need this */
 #include <asm/system.h>
 #include <asm/asi.h>
+#include <asm-generic/pci_iomap.h>
 
 /* PC crapola... */
 #define __SLOW_DOWN_IO do { } while (0)
@@ -514,7 +515,6 @@ extern void ioport_unmap(void __iomem *);
 
 /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
 struct pci_dev;
-extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
 extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
 
 static inline int sbus_can_dma_64bit(void)
index 9ef37e13a920e28ba99e197dc50dff7b812c5972..c4d42a50ebc06d3f92fdae70aa7d1f1d64a5b6f7 100644 (file)
@@ -18,31 +18,8 @@ void ioport_unmap(void __iomem *addr)
 EXPORT_SYMBOL(ioport_map);
 EXPORT_SYMBOL(ioport_unmap);
 
-/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
-void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
-{
-       resource_size_t start = pci_resource_start(dev, bar);
-       resource_size_t len = pci_resource_len(dev, bar);
-       unsigned long flags = pci_resource_flags(dev, bar);
-
-       if (!len || !start)
-               return NULL;
-       if (maxlen && len > maxlen)
-               len = maxlen;
-       if (flags & IORESOURCE_IO)
-               return ioport_map(start, len);
-       if (flags & IORESOURCE_MEM) {
-               if (flags & IORESOURCE_CACHEABLE)
-                       return ioremap(start, len);
-               return ioremap_nocache(start, len);
-       }
-       /* What? */
-       return NULL;
-}
-
 void pci_iounmap(struct pci_dev *dev, void __iomem * addr)
 {
        /* nothing to do */
 }
-EXPORT_SYMBOL(pci_iomap);
 EXPORT_SYMBOL(pci_iounmap);