microblaze/PCI: Remove pci_phys_mem_access_prot() dead code
authorBjorn Helgaas <bhelgaas@google.com>
Fri, 21 Jan 2022 20:51:50 +0000 (14:51 -0600)
committerMichal Simek <michal.simek@xilinx.com>
Mon, 24 Jan 2022 12:11:34 +0000 (13:11 +0100)
pci_phys_mem_access_prot() is defined but never used.  Remove it.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://lore.kernel.org/r/20220121205150.1151607-1-helgaas@kernel.org
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arch/microblaze/include/asm/pci.h
arch/microblaze/pci/pci-common.c

index 7c4dc5d..d905280 100644 (file)
@@ -61,10 +61,6 @@ extern int pci_mmap_legacy_page_range(struct pci_bus *bus,
 extern void pcibios_resource_survey(void);
 
 struct file;
-extern pgprot_t        pci_phys_mem_access_prot(struct file *file,
-                                        unsigned long pfn,
-                                        unsigned long size,
-                                        pgprot_t prot);
 
 /* This part of code was originally in xilinx-pci.h */
 #ifdef CONFIG_PCI_XILINX
index 622a486..33bab7e 100644 (file)
@@ -165,55 +165,6 @@ int pci_iobar_pfn(struct pci_dev *pdev, int bar, struct vm_area_struct *vma)
        return 0;
 }
 
-/*
- * This one is used by /dev/mem and fbdev who have no clue about the
- * PCI device, it tries to find the PCI device first and calls the
- * above routine
- */
-pgprot_t pci_phys_mem_access_prot(struct file *file,
-                                 unsigned long pfn,
-                                 unsigned long size,
-                                 pgprot_t prot)
-{
-       struct pci_dev *pdev = NULL;
-       struct resource *found = NULL;
-       resource_size_t offset = ((resource_size_t)pfn) << PAGE_SHIFT;
-       int i;
-
-       if (page_is_ram(pfn))
-               return prot;
-
-       prot = pgprot_noncached(prot);
-       for_each_pci_dev(pdev) {
-               for (i = 0; i <= PCI_ROM_RESOURCE; i++) {
-                       struct resource *rp = &pdev->resource[i];
-                       int flags = rp->flags;
-
-                       /* Active and same type? */
-                       if ((flags & IORESOURCE_MEM) == 0)
-                               continue;
-                       /* In the range of this resource? */
-                       if (offset < (rp->start & PAGE_MASK) ||
-                           offset > rp->end)
-                               continue;
-                       found = rp;
-                       break;
-               }
-               if (found)
-                       break;
-       }
-       if (found) {
-               if (found->flags & IORESOURCE_PREFETCH)
-                       prot = pgprot_noncached_wc(prot);
-               pci_dev_put(pdev);
-       }
-
-       pr_debug("PCI: Non-PCI map for %llx, prot: %lx\n",
-                (unsigned long long)offset, pgprot_val(prot));
-
-       return prot;
-}
-
 /* This provides legacy IO read access on a bus */
 int pci_legacy_read(struct pci_bus *bus, loff_t port, u32 *val, size_t size)
 {