Skip to content

Commit 4365792

Browse files
Philipp Stannerbjorn-helgaas
authored andcommitted
fpga/dfl-pci.c: Replace deprecated PCI functions
pcim_iomap_regions() and pcim_iomap_table() have been deprecated by the PCI subsystem in commit e354bb8 ("PCI: Deprecate pcim_iomap_table(), pcim_iomap_regions_request_all()"). Port dfl-pci.c to the successor, pcim_iomap_region(). Consistently, replace pcim_iounmap_regions() with pcim_iounmap_region(). Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Philipp Stanner <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Acked-by: Xu Yilun <[email protected]>
1 parent 083b0ac commit 4365792

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

drivers/fpga/dfl-pci.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@ struct cci_drvdata {
3939
struct dfl_fpga_cdev *cdev; /* container device */
4040
};
4141

42-
static void __iomem *cci_pci_ioremap_bar0(struct pci_dev *pcidev)
43-
{
44-
if (pcim_iomap_regions(pcidev, BIT(0), DRV_NAME))
45-
return NULL;
46-
47-
return pcim_iomap_table(pcidev)[0];
48-
}
49-
5042
static int cci_pci_alloc_irq(struct pci_dev *pcidev)
5143
{
5244
int ret, nvec = pci_msix_vec_count(pcidev);
@@ -235,9 +227,9 @@ static int find_dfls_by_default(struct pci_dev *pcidev,
235227
u64 v;
236228

237229
/* start to find Device Feature List from Bar 0 */
238-
base = cci_pci_ioremap_bar0(pcidev);
239-
if (!base)
240-
return -ENOMEM;
230+
base = pcim_iomap_region(pcidev, 0, DRV_NAME);
231+
if (IS_ERR(base))
232+
return PTR_ERR(base);
241233

242234
/*
243235
* PF device has FME and Ports/AFUs, and VF device only has one
@@ -296,7 +288,7 @@ static int find_dfls_by_default(struct pci_dev *pcidev,
296288
}
297289

298290
/* release I/O mappings for next step enumeration */
299-
pcim_iounmap_regions(pcidev, BIT(0));
291+
pcim_iounmap_region(pcidev, 0);
300292

301293
return ret;
302294
}

0 commit comments

Comments
 (0)