]> Git Repo - J-linux.git/commitdiff
x86/platform/intel-mid: Replace deprecated PCI functions
authorPhilipp Stanner <[email protected]>
Mon, 11 Nov 2024 10:36:03 +0000 (11:36 +0100)
committerBorislav Petkov (AMD) <[email protected]>
Mon, 11 Nov 2024 10:59:21 +0000 (11:59 +0100)
pcim_iomap_table() and pcim_request_regions() have been deprecated in

  e354bb84a4c1 ("PCI: Deprecate pcim_iomap_table(), pcim_iomap_regions_request_all()") and
  d140f80f6035 ("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 <[email protected]>
Signed-off-by: Borislav Petkov (AMD) <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
arch/x86/platform/intel-mid/pwr.c

index 27288d8d3f719bf77fb62cdc337de7cd5ab051cd..cd7e0c71addef69b7b5b3c1c1aec4eaee72cad1f 100644 (file)
@@ -358,18 +358,18 @@ static int mid_pwr_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                return ret;
        }
 
-       ret = pcim_iomap_regions(pdev, 1 << 0, pci_name(pdev));
-       if (ret) {
-               dev_err(&pdev->dev, "I/O memory remapping failed\n");
-               return ret;
-       }
-
        pwr = devm_kzalloc(dev, sizeof(*pwr), GFP_KERNEL);
        if (!pwr)
                return -ENOMEM;
 
+       pwr->regs = pcim_iomap_region(pdev, 0, "intel_mid_pwr");
+       ret = PTR_ERR_OR_ZERO(pwr->regs);
+       if (ret) {
+               dev_err(&pdev->dev, "Could not request / ioremap I/O-Mem: %d\n", ret);
+               return ret;
+       }
+
        pwr->dev = dev;
-       pwr->regs = pcim_iomap_table(pdev)[0];
        pwr->irq = pdev->irq;
 
        mutex_init(&pwr->lock);
This page took 0.04749 seconds and 4 git commands to generate.