Skip to content

Commit

Permalink
vxge: Use PCI Express Capability accessors
Browse files Browse the repository at this point in the history
Use PCI Express Capability access functions to simplify vxge driver.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
  • Loading branch information
Jiang Liu authored and Bjorn Helgaas committed Aug 23, 2012
1 parent 23d028c commit d892aa0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/neterion/vxge/vxge-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ __vxge_hw_verify_pci_e_info(struct __vxge_hw_device *hldev)
u16 lnk;

/* Get the negotiated link width and speed from PCI config space */
pci_read_config_word(dev, dev->pcie_cap + PCI_EXP_LNKSTA, &lnk);
pcie_capability_read_word(dev, PCI_EXP_LNKSTA, &lnk);

if ((lnk & PCI_EXP_LNKSTA_CLS) != 1)
return VXGE_HW_ERR_INVALID_PCI_INFO;
Expand Down Expand Up @@ -1982,7 +1982,7 @@ u16 vxge_hw_device_link_width_get(struct __vxge_hw_device *hldev)
struct pci_dev *dev = hldev->pdev;
u16 lnk;

pci_read_config_word(dev, dev->pcie_cap + PCI_EXP_LNKSTA, &lnk);
pcie_capability_read_word(dev, PCI_EXP_LNKSTA, &lnk);
return (lnk & VXGE_HW_PCI_EXP_LNKCAP_LNK_WIDTH) >> 4;
}

Expand Down

0 comments on commit d892aa0

Please sign in to comment.