Skip to content

Commit 64fe9bc

Browse files
Philipp Stannerbjorn-helgaas
authored andcommitted
ethernet: cavium: 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()"). Replace the deprecated PCI functions with their successors. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Philipp Stanner <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Acked-by: Paolo Abeni <[email protected]>
1 parent 4996656 commit 64fe9bc

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/net/ethernet/cavium/common/cavium_ptp.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,11 @@ static int cavium_ptp_probe(struct pci_dev *pdev,
239239
if (err)
240240
goto error_free;
241241

242-
err = pcim_iomap_regions(pdev, 1 << PCI_PTP_BAR_NO, pci_name(pdev));
242+
clock->reg_base = pcim_iomap_region(pdev, PCI_PTP_BAR_NO, pci_name(pdev));
243+
err = PTR_ERR_OR_ZERO(clock->reg_base);
243244
if (err)
244245
goto error_free;
245246

246-
clock->reg_base = pcim_iomap_table(pdev)[PCI_PTP_BAR_NO];
247-
248247
spin_lock_init(&clock->spin_lock);
249248

250249
cc = &clock->cycle_counter;
@@ -292,7 +291,7 @@ static int cavium_ptp_probe(struct pci_dev *pdev,
292291
clock_cfg = readq(clock->reg_base + PTP_CLOCK_CFG);
293292
clock_cfg &= ~PTP_CLOCK_CFG_PTP_EN;
294293
writeq(clock_cfg, clock->reg_base + PTP_CLOCK_CFG);
295-
pcim_iounmap_regions(pdev, 1 << PCI_PTP_BAR_NO);
294+
pcim_iounmap_region(pdev, PCI_PTP_BAR_NO);
296295

297296
error_free:
298297
devm_kfree(dev, clock);

0 commit comments

Comments
 (0)