]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
intel_th: pci: Replace deprecated PCI functions
authorPhilipp Stanner <pstanner@redhat.com>
Wed, 30 Oct 2024 11:27:38 +0000 (12:27 +0100)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 30 Oct 2024 21:07:37 +0000 (16:07 -0500)
pcim_iomap_table() and pcim_iomap_regions_request_all() have been
deprecated by the PCI subsystem in commit e354bb84a4c1 ("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/20241030112743.104395-6-pstanner@redhat.com
Signed-off-by: Philipp Stanner <pstanner@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
drivers/hwtracing/intel_th/pci.c

index 0d7b9839e5b66318838ed5c505e76e96ae107191..e9d8d28e055f366b0877e8a215a5b0bb14bf735a 100644 (file)
@@ -23,7 +23,6 @@ enum {
        TH_PCI_RTIT_BAR         = 4,
 };
 
-#define BAR_MASK (BIT(TH_PCI_CONFIG_BAR) | BIT(TH_PCI_STH_SW_BAR))
 
 #define PCI_REG_NPKDSC 0x80
 #define NPKDSC_TSACT   BIT(5)
@@ -83,10 +82,16 @@ static int intel_th_pci_probe(struct pci_dev *pdev,
        if (err)
                return err;
 
-       err = pcim_iomap_regions_request_all(pdev, BAR_MASK, DRIVER_NAME);
+       err = pcim_request_all_regions(pdev, DRIVER_NAME);
        if (err)
                return err;
 
+       if (!pcim_iomap(pdev, TH_PCI_CONFIG_BAR, 0))
+               return -ENOMEM;
+
+       if (!pcim_iomap(pdev, TH_PCI_STH_SW_BAR, 0))
+               return -ENOMEM;
+
        if (pdev->resource[TH_PCI_RTIT_BAR].start) {
                resource[TH_MMIO_RTIT] = pdev->resource[TH_PCI_RTIT_BAR];
                r++;