Skip to content

Commit fcc6196

Browse files
bjorn-helgaasMichal Simek
authored andcommitted
microblaze/PCI: Remove pci_phys_mem_access_prot() dead code
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>
1 parent 19d448a commit fcc6196

File tree

2 files changed

+0
-53
lines changed

2 files changed

+0
-53
lines changed

arch/microblaze/include/asm/pci.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ extern int pci_mmap_legacy_page_range(struct pci_bus *bus,
6161
extern void pcibios_resource_survey(void);
6262

6363
struct file;
64-
extern pgprot_t pci_phys_mem_access_prot(struct file *file,
65-
unsigned long pfn,
66-
unsigned long size,
67-
pgprot_t prot);
6864

6965
/* This part of code was originally in xilinx-pci.h */
7066
#ifdef CONFIG_PCI_XILINX

arch/microblaze/pci/pci-common.c

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -165,55 +165,6 @@ int pci_iobar_pfn(struct pci_dev *pdev, int bar, struct vm_area_struct *vma)
165165
return 0;
166166
}
167167

168-
/*
169-
* This one is used by /dev/mem and fbdev who have no clue about the
170-
* PCI device, it tries to find the PCI device first and calls the
171-
* above routine
172-
*/
173-
pgprot_t pci_phys_mem_access_prot(struct file *file,
174-
unsigned long pfn,
175-
unsigned long size,
176-
pgprot_t prot)
177-
{
178-
struct pci_dev *pdev = NULL;
179-
struct resource *found = NULL;
180-
resource_size_t offset = ((resource_size_t)pfn) << PAGE_SHIFT;
181-
int i;
182-
183-
if (page_is_ram(pfn))
184-
return prot;
185-
186-
prot = pgprot_noncached(prot);
187-
for_each_pci_dev(pdev) {
188-
for (i = 0; i <= PCI_ROM_RESOURCE; i++) {
189-
struct resource *rp = &pdev->resource[i];
190-
int flags = rp->flags;
191-
192-
/* Active and same type? */
193-
if ((flags & IORESOURCE_MEM) == 0)
194-
continue;
195-
/* In the range of this resource? */
196-
if (offset < (rp->start & PAGE_MASK) ||
197-
offset > rp->end)
198-
continue;
199-
found = rp;
200-
break;
201-
}
202-
if (found)
203-
break;
204-
}
205-
if (found) {
206-
if (found->flags & IORESOURCE_PREFETCH)
207-
prot = pgprot_noncached_wc(prot);
208-
pci_dev_put(pdev);
209-
}
210-
211-
pr_debug("PCI: Non-PCI map for %llx, prot: %lx\n",
212-
(unsigned long long)offset, pgprot_val(prot));
213-
214-
return prot;
215-
}
216-
217168
/* This provides legacy IO read access on a bus */
218169
int pci_legacy_read(struct pci_bus *bus, loff_t port, u32 *val, size_t size)
219170
{

0 commit comments

Comments
 (0)