aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/myri10ge/myri10ge.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index a0d4c619e859..42ea4f809171 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -1081,7 +1081,7 @@ static int myri10ge_toggle_relaxed(struct pci_dev *pdev, int on)
1081 int ret, cap, err; 1081 int ret, cap, err;
1082 u16 ctl; 1082 u16 ctl;
1083 1083
1084 cap = pci_find_capability(pdev, PCI_CAP_ID_EXP); 1084 cap = pci_pcie_cap(pdev);
1085 if (!cap) 1085 if (!cap)
1086 return 0; 1086 return 0;
1087 1087
@@ -3191,7 +3191,7 @@ static void myri10ge_enable_ecrc(struct myri10ge_priv *mgp)
3191{ 3191{
3192 struct pci_dev *bridge = mgp->pdev->bus->self; 3192 struct pci_dev *bridge = mgp->pdev->bus->self;
3193 struct device *dev = &mgp->pdev->dev; 3193 struct device *dev = &mgp->pdev->dev;
3194 unsigned cap; 3194 int cap;
3195 unsigned err_cap; 3195 unsigned err_cap;
3196 u16 val; 3196 u16 val;
3197 u8 ext_type; 3197 u8 ext_type;
@@ -3201,7 +3201,7 @@ static void myri10ge_enable_ecrc(struct myri10ge_priv *mgp)
3201 return; 3201 return;
3202 3202
3203 /* check that the bridge is a root port */ 3203 /* check that the bridge is a root port */
3204 cap = pci_find_capability(bridge, PCI_CAP_ID_EXP); 3204 cap = pci_pcie_cap(bridge);
3205 pci_read_config_word(bridge, cap + PCI_CAP_FLAGS, &val); 3205 pci_read_config_word(bridge, cap + PCI_CAP_FLAGS, &val);
3206 ext_type = (val & PCI_EXP_FLAGS_TYPE) >> 4; 3206 ext_type = (val & PCI_EXP_FLAGS_TYPE) >> 4;
3207 if (ext_type != PCI_EXP_TYPE_ROOT_PORT) { 3207 if (ext_type != PCI_EXP_TYPE_ROOT_PORT) {
@@ -3219,8 +3219,7 @@ static void myri10ge_enable_ecrc(struct myri10ge_priv *mgp)
3219 " to force ECRC\n"); 3219 " to force ECRC\n");
3220 return; 3220 return;
3221 } 3221 }
3222 cap = 3222 cap = pci_pcie_cap(bridge);
3223 pci_find_capability(bridge, PCI_CAP_ID_EXP);
3224 pci_read_config_word(bridge, 3223 pci_read_config_word(bridge,
3225 cap + PCI_CAP_FLAGS, &val); 3224 cap + PCI_CAP_FLAGS, &val);
3226 ext_type = (val & PCI_EXP_FLAGS_TYPE) >> 4; 3225 ext_type = (val & PCI_EXP_FLAGS_TYPE) >> 4;
@@ -3341,7 +3340,7 @@ static void myri10ge_select_firmware(struct myri10ge_priv *mgp)
3341 int link_width, exp_cap; 3340 int link_width, exp_cap;
3342 u16 lnk; 3341 u16 lnk;
3343 3342
3344 exp_cap = pci_find_capability(mgp->pdev, PCI_CAP_ID_EXP); 3343 exp_cap = pci_pcie_cap(mgp->pdev);
3345 pci_read_config_word(mgp->pdev, exp_cap + PCI_EXP_LNKSTA, &lnk); 3344 pci_read_config_word(mgp->pdev, exp_cap + PCI_EXP_LNKSTA, &lnk);
3346 link_width = (lnk >> 4) & 0x3f; 3345 link_width = (lnk >> 4) & 0x3f;
3347 3346