drivers: net: wireless: Replace deprecated PCI function
Subsystems (2)
PATCH 1/1 drivers: net: wireless: 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 <[email protected]>
--- drivers/net/wireless/mediatek/mt76/mt7921/pci.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7921/pci.c +1 -5
@@ -284,10 +284,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 ;
@@ -325,7 +321,7 @@ static int mt7921_pci_probe(struct pci_dev *pdev, 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,pcim_iomap_region (pdev,0 ,pci_name (pdev)));tasklet_init (&mdev->irq_tasklet, mt792x_irq_tasklet, (unsigned long )dev); dev->phy.dev = dev;
Signature · 1 line
2.52.0
Hi,
Quoted 4 lines · Madhur Kumar
pcim_iomap_table()andpcim_iomap_regions()have been deprecated.
Replace them withpcim_iomap_region().
The patch subject is wrong, please read
https://wireless.docs.kernel.org/en/latest/en/developers/documentation/submittingpatches.html
Quoted 22 lines
Signed-off-by Madhur Kumar <[email protected]>--- drivers/net/wireless/mediatek/mt76/mt7921/pci.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)drivers/net/wireless/mediatek/mt76/mt7921/pci.c +0
-4@@ -284,10 +284,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 ;
drivers/net/wireless/mediatek/mt76/mt7921/pci.c static int mt7921_pci_probe(struct pci_dev *pdev, · line 324
Quoted 5 lines
drivers/net/wireless/mediatek/mt76/mt7921/pci.c +1
-1@@ -325,7 +321,7 @@ static int mt7921_pci_probe(struct pci_dev *pdev, 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,pcim_iomap_region (pdev,0 ,pci_name (pdev)));
You are effectively removing the error checking by directly passing the result of pcim_iomap_region() to mt76_mmio_init(). You need to first make sure that pcim_iomap_region() succeeded.
Best regards,
Jonas