wifi: ath9k: use unmanaged PCI functions in ath9k_pci_owl_loader
authorHeiner Kallweit <hkallweit1@gmail.com>
Tue, 9 Apr 2024 20:28:27 +0000 (22:28 +0200)
committerKalle Valo <quic_kvalo@quicinc.com>
Thu, 1 Aug 2024 14:58:47 +0000 (17:58 +0300)
Only managed PCI resource in the driver is the iomapped bar. However the bar
is unmapped in the same function. Therefore using the device-managed
versions just causes overhead, w/o any benefit. Once this is switched to the
non-managed versions, there's nothing left to be managed for
pcim_enable_device(). Therefore we can reduce overhead here too and switch to
the non-managed version as well. This includes removing the no longer needed
call to pcim_pin_device().

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://patch.msgid.link/3b46f6c7-4372-4cc9-9a7c-2c1c06d29324@gmail.com
drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c

index a5eb43f3032013c6943039c15ce1962ec8c44617..004ca5f536bec5e72110e30fd358d0d8968c5140 100644 (file)
@@ -65,7 +65,7 @@ static int ath9k_pci_fixup(struct pci_dev *pdev, const u16 *cal_data,
 
        dev_info(&pdev->dev, "fixup device configuration\n");
 
-       mem = pcim_iomap(pdev, 0, 0);
+       mem = pci_iomap(pdev, 0, 0);
        if (!mem) {
                dev_err(&pdev->dev, "ioremap error\n");
                return -EINVAL;
@@ -103,7 +103,7 @@ static int ath9k_pci_fixup(struct pci_dev *pdev, const u16 *cal_data,
        pci_write_config_word(pdev, PCI_COMMAND, cmd);
 
        pci_write_config_dword(pdev, PCI_BASE_ADDRESS_0, bar0);
-       pcim_iounmap(pdev, mem);
+       pci_iounmap(pdev, mem);
 
        pci_disable_device(pdev);
 
@@ -200,11 +200,9 @@ static int owl_probe(struct pci_dev *pdev,
        const char *eeprom_name;
        int err = 0;
 
-       if (pcim_enable_device(pdev))
+       if (pci_enable_device(pdev))
                return -EIO;
 
-       pcim_pin_device(pdev);
-
        ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
        if (!ctx)
                return -ENOMEM;