]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: mt76: mt7921: Replace deprecated PCI function
authorMadhur Kumar <madhurkumar004@gmail.com>
Mon, 8 Dec 2025 17:23:31 +0000 (22:53 +0530)
committerFelix Fietkau <nbd@nbd.name>
Mon, 23 Mar 2026 09:23:01 +0000 (09:23 +0000)
pcim_iomap_table() and pcim_iomap_regions() have been
deprecated.
Replace them with pcim_iomap_region().

Signed-off-by: Madhur Kumar <madhurkumar004@gmail.com>
Link: https://patch.msgid.link/20251208172331.89705-1-madhurkumar004@gmail.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7921/pci.c

index ec9686183251c237c37ba5f49cb6976da122a2a2..65c7fe67113705de4b802562579ed6f45718e87f 100644 (file)
@@ -276,6 +276,7 @@ static int mt7921_pci_probe(struct pci_dev *pdev,
        struct mt76_bus_ops *bus_ops;
        struct mt792x_dev *dev;
        struct mt76_dev *mdev;
+       void __iomem *regs;
        u16 cmd, chipid;
        u8 features;
        int ret;
@@ -284,10 +285,6 @@ static int mt7921_pci_probe(struct pci_dev *pdev,
        if (ret)
                return ret;
 
-       ret = pcim_iomap_regions(pdev, BIT(0), pci_name(pdev));
-       if (ret)
-               return ret;
-
        pci_read_config_word(pdev, PCI_COMMAND, &cmd);
        if (!(cmd & PCI_COMMAND_MEMORY)) {
                cmd |= PCI_COMMAND_MEMORY;
@@ -321,11 +318,15 @@ static int mt7921_pci_probe(struct pci_dev *pdev,
 
        pci_set_drvdata(pdev, mdev);
 
+       regs =  pcim_iomap_region(pdev, 0, pci_name(pdev));
+       if (IS_ERR(regs))
+               return PTR_ERR(regs);
+
        dev = container_of(mdev, struct mt792x_dev, mt76);
        dev->fw_features = features;
        dev->hif_ops = &mt7921_pcie_ops;
        dev->irq_map = &irq_map;
-       mt76_mmio_init(&dev->mt76, pcim_iomap_table(pdev)[0]);
+       mt76_mmio_init(&dev->mt76, regs);
        tasklet_init(&mdev->irq_tasklet, mt792x_irq_tasklet, (unsigned long)dev);
 
        dev->phy.dev = dev;