]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: pt3: Replace deprecated PCI functions
authorPhilipp Stanner <phasta@kernel.org>
Fri, 4 Apr 2025 13:53:42 +0000 (15:53 +0200)
committerHans Verkuil <hverkuil@xs4all.nl>
Fri, 25 Apr 2025 13:14:30 +0000 (15:14 +0200)
pcim_iomap_table() and pcim_iomap_regions() have been deprecated.
Replace them with pcim_iomap_region().

Signed-off-by: Philipp Stanner <phasta@kernel.org>
Tested-by: Akihiro Tsukada <tskd08@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/pci/pt3/pt3.c

index 246f73b8a9e794eab4dfd62b275ebf794e0a34d9..c55aa782b72c23d837bd207d1e9b7b41aaec6b31 100644 (file)
@@ -692,6 +692,7 @@ static int pt3_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        u8 rev;
        u32 ver;
        int i, ret;
+       void __iomem *iomem;
        struct pt3_board *pt3;
        struct i2c_adapter *i2c;
 
@@ -703,10 +704,6 @@ static int pt3_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                return -ENODEV;
        pci_set_master(pdev);
 
-       ret = pcim_iomap_regions(pdev, BIT(0) | BIT(2), DRV_NAME);
-       if (ret < 0)
-               return ret;
-
        ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
        if (ret) {
                dev_err(&pdev->dev, "Failed to set DMA mask\n");
@@ -719,8 +716,16 @@ static int pt3_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        pci_set_drvdata(pdev, pt3);
        pt3->pdev = pdev;
        mutex_init(&pt3->lock);
-       pt3->regs[0] = pcim_iomap_table(pdev)[0];
-       pt3->regs[1] = pcim_iomap_table(pdev)[2];
+
+       iomem = pcim_iomap_region(pdev, 0, DRV_NAME);
+       if (IS_ERR(iomem))
+               return PTR_ERR(iomem);
+       pt3->regs[0] = iomem;
+
+       iomem = pcim_iomap_region(pdev, 2, DRV_NAME);
+       if (IS_ERR(iomem))
+               return PTR_ERR(iomem);
+       pt3->regs[1] = iomem;
 
        ver = ioread32(pt3->regs[0] + REG_VERSION);
        if ((ver >> 16) != 0x0301) {