Skip to content

Commit 4eefc43

Browse files
MadhurKumar004nbd168
authored andcommitted
wifi: mt76: mt7921: Replace deprecated PCI function
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>
1 parent 54d7559 commit 4eefc43

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

  • drivers/net/wireless/mediatek/mt76/mt7921

drivers/net/wireless/mediatek/mt76/mt7921/pci.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ static int mt7921_pci_probe(struct pci_dev *pdev,
276276
struct mt76_bus_ops *bus_ops;
277277
struct mt792x_dev *dev;
278278
struct mt76_dev *mdev;
279+
void __iomem *regs;
279280
u16 cmd, chipid;
280281
u8 features;
281282
int ret;
@@ -284,10 +285,6 @@ static int mt7921_pci_probe(struct pci_dev *pdev,
284285
if (ret)
285286
return ret;
286287

287-
ret = pcim_iomap_regions(pdev, BIT(0), pci_name(pdev));
288-
if (ret)
289-
return ret;
290-
291288
pci_read_config_word(pdev, PCI_COMMAND, &cmd);
292289
if (!(cmd & PCI_COMMAND_MEMORY)) {
293290
cmd |= PCI_COMMAND_MEMORY;
@@ -321,11 +318,15 @@ static int mt7921_pci_probe(struct pci_dev *pdev,
321318

322319
pci_set_drvdata(pdev, mdev);
323320

321+
regs = pcim_iomap_region(pdev, 0, pci_name(pdev));
322+
if (IS_ERR(regs))
323+
return PTR_ERR(regs);
324+
324325
dev = container_of(mdev, struct mt792x_dev, mt76);
325326
dev->fw_features = features;
326327
dev->hif_ops = &mt7921_pcie_ops;
327328
dev->irq_map = &irq_map;
328-
mt76_mmio_init(&dev->mt76, pcim_iomap_table(pdev)[0]);
329+
mt76_mmio_init(&dev->mt76, regs);
329330
tasklet_init(&mdev->irq_tasklet, mt792x_irq_tasklet, (unsigned long)dev);
330331

331332
dev->phy.dev = dev;

0 commit comments

Comments
 (0)