]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
microblaze: switch to GENERIC_PCI_IOMAP
authorMichael S. Tsirkin <mst@redhat.com>
Thu, 24 Nov 2011 19:06:41 +0000 (21:06 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 28 Nov 2011 19:13:10 +0000 (21:13 +0200)
microblaze 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.

The only difference is handling of nocache flag,
that turns out to be done correctly by the
generic code since arch/microblaze/include/asm/io.h
defines ioremap_nocache same as ioremap.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
arch/microblaze/Kconfig
arch/microblaze/pci/iomap.c

index e446bab2427bc7c69982190f3e89c0f442752780..f0eead74fff67d1c4eb0af6eae23d1fcb26720b0 100644 (file)
@@ -17,6 +17,7 @@ config MICROBLAZE
        select HAVE_GENERIC_HARDIRQS
        select GENERIC_IRQ_PROBE
        select GENERIC_IRQ_SHOW
+       select GENERIC_PCI_IOMAP
 
 config SWAP
        def_bool n
index 57acda852f5a4723c7a294520b8fb6d51494cb54..b07abbac03197963c43011ceea69d2ec4c834b1f 100644 (file)
 #include <asm/io.h>
 #include <asm/pci-bridge.h>
 
-void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max)
-{
-       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)
-               return NULL;
-       if (max && len > max)
-               len = max;
-       if (flags & IORESOURCE_IO)
-               return ioport_map(start, len);
-       if (flags & IORESOURCE_MEM)
-               return ioremap(start, len);
-       /* What? */
-       return NULL;
-}
-EXPORT_SYMBOL(pci_iomap);
-
 void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
 {
        if (isa_vaddr_is_ioport(addr))