summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rtlwifi
diff options
context:
space:
mode:
authorJiang Liu <jiang.liu@huawei.com>2012-08-20 22:18:08 +0200
committerBjorn Helgaas <bhelgaas@google.com>2012-08-23 18:11:15 +0200
commit332badc323e3846faca15b110c22d62946c1df60 (patch)
tree48fd55607b2a8d4bed787df428446b0b4ac441e2 /drivers/net/wireless/rtlwifi
parentiwlwifi: Use PCI Express Capability accessors (diff)
downloadlinux-332badc323e3846faca15b110c22d62946c1df60.tar.xz
linux-332badc323e3846faca15b110c22d62946c1df60.zip
rtlwifi: Use PCI Express Capability accessors
Use PCI Express Capability access functions to simplify rtlwifi 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>
Diffstat (limited to 'drivers/net/wireless/rtlwifi')
-rw-r--r--drivers/net/wireless/rtlwifi/pci.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index 80f75d3ba84a..5983631a1b1a 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -372,13 +372,11 @@ static void rtl_pci_parse_configuration(struct pci_dev *pdev,
struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw);
u8 tmp;
- int pos;
- u8 linkctrl_reg;
+ u16 linkctrl_reg;
/*Link Control Register */
- pos = pci_pcie_cap(pdev);
- pci_read_config_byte(pdev, pos + PCI_EXP_LNKCTL, &linkctrl_reg);
- pcipriv->ndis_adapter.linkctrl_reg = linkctrl_reg;
+ pcie_capability_read_word(pdev, PCI_EXP_LNKCTL, &linkctrl_reg);
+ pcipriv->ndis_adapter.linkctrl_reg = (u8)linkctrl_reg;
RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, "Link Control Register =%x\n",
pcipriv->ndis_adapter.linkctrl_reg);