iwlwifi: remove unnecessary read of PCI_CAP_ID_EXP
authorJon Mason <jdmason@kudzu.us>
Thu, 30 Jun 2011 15:42:47 +0000 (10:42 -0500)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 6 Jul 2011 19:05:41 +0000 (15:05 -0400)
The PCIE capability offset is saved during PCI bus walking.  It will
remove an unnecessary search in the PCI configuration space if this
value is referenced instead of reacquiring it.

Signed-off-by: Jon Mason <jdmason@kudzu.us>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-pci.c

index 2c26b42bd15864b34417bda28c63259a7a6edadb..74911348a2ee31169ca722d6420c2f38aed832d8 100644 (file)
@@ -94,7 +94,7 @@ static u16 iwl_pciexp_link_ctrl(struct iwl_bus *bus)
        u16 pci_lnk_ctl;
        struct pci_dev *pci_dev = IWL_BUS_GET_PCI_DEV(bus);
 
-       pos = pci_find_capability(pci_dev, PCI_CAP_ID_EXP);
+       pos = pci_pcie_cap(pci_dev);
        pci_read_config_word(pci_dev, pos + PCI_EXP_LNKCTL, &pci_lnk_ctl);
        return pci_lnk_ctl;
 }