iwlegacy: Use PCI Express Capability accessors
authorJiang Liu <jiang.liu@huawei.com>
Mon, 20 Aug 2012 20:15:58 +0000 (14:15 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 23 Aug 2012 16:11:14 +0000 (10:11 -0600)
Use PCI Express Capability access functions to simplify iwlegacy driver.

[bhelgaas: split iwlegacy, iwlwifi, rtlwifi into separate patches]
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/net/wireless/iwlegacy/common.h

index 5f50177..7246826 100644 (file)
@@ -1832,10 +1832,8 @@ int il_enqueue_hcmd(struct il_priv *il, struct il_host_cmd *cmd);
 static inline u16
 il_pcie_link_ctl(struct il_priv *il)
 {
-       int pos;
        u16 pci_lnk_ctl;
-       pos = pci_pcie_cap(il->pci_dev);
-       pci_read_config_word(il->pci_dev, pos + PCI_EXP_LNKCTL, &pci_lnk_ctl);
+       pcie_capability_read_word(il->pci_dev, PCI_EXP_LNKCTL, &pci_lnk_ctl);
        return pci_lnk_ctl;
 }