rtl8192e: Use PCI Express Capability accessors

Use PCI Express Capability access functions to simplify rtl8192e driver.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
This commit is contained in:
Jiang Liu 2012-07-24 17:20:33 +08:00 committed by Bjorn Helgaas
parent 532c5f69e2
commit 479e0d485e
1 changed files with 3 additions and 5 deletions

View File

@ -31,12 +31,10 @@ static void rtl8192_parse_pci_configuration(struct pci_dev *pdev,
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
u8 tmp;
int pos;
u8 LinkCtrlReg;
u16 LinkCtrlReg;
pos = pci_find_capability(priv->pdev, PCI_CAP_ID_EXP);
pci_read_config_byte(priv->pdev, pos + PCI_EXP_LNKCTL, &LinkCtrlReg);
priv->NdisAdapter.LinkCtrlReg = LinkCtrlReg;
pcie_capability_read_word(priv->pdev, PCI_EXP_LNKCTL, &LinkCtrlReg);
priv->NdisAdapter.LinkCtrlReg = (u8)LinkCtrlReg;
RT_TRACE(COMP_INIT, "Link Control Register =%x\n",
priv->NdisAdapter.LinkCtrlReg);