Skip to content

Commit 90f1b42

Browse files
Philipp Stannerbp3tk0v
authored andcommitted
x86/platform/intel-mid: Replace deprecated PCI functions
pcim_iomap_table() and pcim_request_regions() have been deprecated in e354bb8 ("PCI: Deprecate pcim_iomap_table(), pcim_iomap_regions_request_all()") and d140f80 ("PCI: Deprecate pcim_iomap_regions() in favor of pcim_iomap_region()"), respectively. Replace these functions with pcim_iomap_region(). Additionally, pass the actual driver name to pcim_iomap_region() instead of the previous pci_name(), since the @name parameter should always reflect which driver owns a region. Signed-off-by: Philipp Stanner <pstanner@redhat.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20241111103602.16615-2-pstanner@redhat.com
1 parent 2d5404c commit 90f1b42

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

  • arch/x86/platform/intel-mid

arch/x86/platform/intel-mid/pwr.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -358,18 +358,18 @@ static int mid_pwr_probe(struct pci_dev *pdev, const struct pci_device_id *id)
358358
return ret;
359359
}
360360

361-
ret = pcim_iomap_regions(pdev, 1 << 0, pci_name(pdev));
362-
if (ret) {
363-
dev_err(&pdev->dev, "I/O memory remapping failed\n");
364-
return ret;
365-
}
366-
367361
pwr = devm_kzalloc(dev, sizeof(*pwr), GFP_KERNEL);
368362
if (!pwr)
369363
return -ENOMEM;
370364

365+
pwr->regs = pcim_iomap_region(pdev, 0, "intel_mid_pwr");
366+
ret = PTR_ERR_OR_ZERO(pwr->regs);
367+
if (ret) {
368+
dev_err(&pdev->dev, "Could not request / ioremap I/O-Mem: %d\n", ret);
369+
return ret;
370+
}
371+
371372
pwr->dev = dev;
372-
pwr->regs = pcim_iomap_table(pdev)[0];
373373
pwr->irq = pdev->irq;
374374

375375
mutex_init(&pwr->lock);

0 commit comments

Comments
 (0)