Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fpga/dfl-pci.c: Replace deprecated PCI functions

pcim_iomap_regions() and pcim_iomap_table() have been deprecated by the
PCI subsystem in commit e354bb84a4c1 ("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/20241016094911.24818-5-pstanner@redhat.com
Signed-off-by: Philipp Stanner <pstanner@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Acked-by: Xu Yilun <yilun.xu@intel.com>

authored by

Philipp Stanner and committed by
Bjorn Helgaas
43657924 083b0ac4

+4 -12
+4 -12
drivers/fpga/dfl-pci.c
··· 39 39 struct dfl_fpga_cdev *cdev; /* container device */ 40 40 }; 41 41 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 - 50 42 static int cci_pci_alloc_irq(struct pci_dev *pcidev) 51 43 { 52 44 int ret, nvec = pci_msix_vec_count(pcidev); ··· 227 235 u64 v; 228 236 229 237 /* start to find Device Feature List from Bar 0 */ 230 - base = cci_pci_ioremap_bar0(pcidev); 231 - if (!base) 232 - return -ENOMEM; 238 + base = pcim_iomap_region(pcidev, 0, DRV_NAME); 239 + if (IS_ERR(base)) 240 + return PTR_ERR(base); 233 241 234 242 /* 235 243 * PF device has FME and Ports/AFUs, and VF device only has one ··· 288 296 } 289 297 290 298 /* release I/O mappings for next step enumeration */ 291 - pcim_iounmap_regions(pcidev, BIT(0)); 299 + pcim_iounmap_region(pcidev, 0); 292 300 293 301 return ret; 294 302 }