]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
MIPS: PCI: Use generic pci_mmap_resource_range()
authorDavid Woodhouse <dwmw@amazon.co.uk>
Wed, 12 Apr 2017 12:26:02 +0000 (13:26 +0100)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 20 Apr 2017 13:47:47 +0000 (08:47 -0500)
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
arch/mips/include/asm/pci.h
arch/mips/pci/pci.c

index 3141e2a8113a547a0da2e9a5599bc6a8f7595fac..1000c1b4c875af4f0d34286c94ab49613569e90a 100644 (file)
@@ -110,7 +110,7 @@ extern unsigned long PCIBIOS_MIN_MEM;
 extern void pcibios_set_master(struct pci_dev *dev);
 
 #define HAVE_PCI_MMAP
-
+#define ARCH_GENERIC_PCI_MMAP_RESOURCE
 #define HAVE_ARCH_PCI_RESOURCE_TO_USER
 
 /*
index f189502041a62ab936daa22a5726cec28bb80d56..bd67ac74fe2d3420509a03647a20856341bb70c8 100644 (file)
@@ -57,28 +57,3 @@ void pci_resource_to_user(const struct pci_dev *dev, int bar,
        *start = fixup_bigphys_addr(rsrc->start, size);
        *end = rsrc->start + size;
 }
-
-int pci_mmap_page_range(struct pci_dev *dev, int bar,
-                       struct vm_area_struct *vma,
-                       enum pci_mmap_state mmap_state, int write_combine)
-{
-       unsigned long prot;
-
-       /*
-        * I/O space can be accessed via normal processor loads and stores on
-        * this platform but for now we elect not to do this and portable
-        * drivers should not do this anyway.
-        */
-       if (mmap_state == pci_mmap_io)
-               return -EINVAL;
-
-       /*
-        * Ignore write-combine; for now only return uncached mappings.
-        */
-       prot = pgprot_val(vma->vm_page_prot);
-       prot = (prot & ~_CACHE_MASK) | _CACHE_UNCACHED;
-       vma->vm_page_prot = __pgprot(prot);
-
-       return remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
-               vma->vm_end - vma->vm_start, vma->vm_page_prot);
-}