Skip to content

Commit 5915997

Browse files
Philipp Stannerbjorn-helgaas
authored andcommitted
ntb: idt: Replace deprecated PCI functions
pcim_iomap_table() and pcim_iomap_regions_request_all() have been deprecated by the PCI subsystem in commit e354bb8 ("PCI: Deprecate pcim_iomap_table(), pcim_iomap_regions_request_all()"). Replace these functions with their successors, pcim_iomap() and pcim_request_all_regions(). Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Philipp Stanner <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Acked-by: Serge Semin <[email protected]>
1 parent 3dd6ed2 commit 5915997

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

drivers/ntb/hw/idt/ntb_hw_idt.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2671,15 +2671,20 @@ static int idt_init_pci(struct idt_ntb_dev *ndev)
26712671
*/
26722672
pci_set_master(pdev);
26732673

2674-
/* Request all BARs resources and map BAR0 only */
2675-
ret = pcim_iomap_regions_request_all(pdev, 1, NTB_NAME);
2674+
/* Request all BARs resources */
2675+
ret = pcim_request_all_regions(pdev, NTB_NAME);
26762676
if (ret != 0) {
26772677
dev_err(&pdev->dev, "Failed to request resources\n");
26782678
goto err_clear_master;
26792679
}
26802680

2681-
/* Retrieve virtual address of BAR0 - PCI configuration space */
2682-
ndev->cfgspc = pcim_iomap_table(pdev)[0];
2681+
/* ioremap BAR0 - PCI configuration space */
2682+
ndev->cfgspc = pcim_iomap(pdev, 0, 0);
2683+
if (!ndev->cfgspc) {
2684+
dev_err(&pdev->dev, "Failed to ioremap BAR 0\n");
2685+
ret = -ENOMEM;
2686+
goto err_clear_master;
2687+
}
26832688

26842689
/* Put the IDT driver data pointer to the PCI-device private pointer */
26852690
pci_set_drvdata(pdev, ndev);

0 commit comments

Comments
 (0)