aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorJon Mason <jdmason@kudzu.us>2011-06-27 13:40:38 -0400
committerRoland Dreier <roland@purestorage.com>2011-07-18 14:57:52 -0400
commit7f27cda03708e3460849f82b47c604f1492e3777 (patch)
treee6e1648a6df5da07662a9496776baf6dcac765e6 /drivers/infiniband
parent0cd85e6738976b753fb156d833c94083418b3ae4 (diff)
IB/qib: Remove unnecessary read of PCI_CAP_ID_EXP
The PCIE capability offset is saved during PCI bus walking. It will remove an unnecessary search in the PCI configuration space if this value is referenced instead of reacquiring it. Signed-off-by: Jon Mason <jdmason@kudzu.us> Acked-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/qib/qib_pcie.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/qib/qib_pcie.c b/drivers/infiniband/hw/qib/qib_pcie.c
index 891cc2ff5f00..4426782ad288 100644
--- a/drivers/infiniband/hw/qib/qib_pcie.c
+++ b/drivers/infiniband/hw/qib/qib_pcie.c
@@ -255,7 +255,7 @@ int qib_pcie_params(struct qib_devdata *dd, u32 minw, u32 *nent,
255 u16 linkstat, speed; 255 u16 linkstat, speed;
256 int pos = 0, pose, ret = 1; 256 int pos = 0, pose, ret = 1;
257 257
258 pose = pci_find_capability(dd->pcidev, PCI_CAP_ID_EXP); 258 pose = pci_pcie_cap(dd->pcidev);
259 if (!pose) { 259 if (!pose) {
260 qib_dev_err(dd, "Can't find PCI Express capability!\n"); 260 qib_dev_err(dd, "Can't find PCI Express capability!\n");
261 /* set up something... */ 261 /* set up something... */
@@ -509,7 +509,7 @@ static int qib_tune_pcie_coalesce(struct qib_devdata *dd)
509 qib_devinfo(dd->pcidev, "Parent not root\n"); 509 qib_devinfo(dd->pcidev, "Parent not root\n");
510 return 1; 510 return 1;
511 } 511 }
512 ppos = pci_find_capability(parent, PCI_CAP_ID_EXP); 512 ppos = pci_pcie_cap(parent);
513 if (!ppos) 513 if (!ppos)
514 return 1; 514 return 1;
515 if (parent->vendor != 0x8086) 515 if (parent->vendor != 0x8086)
@@ -578,14 +578,14 @@ static int qib_tune_pcie_caps(struct qib_devdata *dd)
578 qib_devinfo(dd->pcidev, "Parent not root\n"); 578 qib_devinfo(dd->pcidev, "Parent not root\n");
579 goto bail; 579 goto bail;
580 } 580 }
581 ppos = pci_find_capability(parent, PCI_CAP_ID_EXP); 581 ppos = pci_pcie_cap(parent);
582 if (ppos) { 582 if (ppos) {
583 pci_read_config_word(parent, ppos + PCI_EXP_DEVCAP, &pcaps); 583 pci_read_config_word(parent, ppos + PCI_EXP_DEVCAP, &pcaps);
584 pci_read_config_word(parent, ppos + PCI_EXP_DEVCTL, &pctl); 584 pci_read_config_word(parent, ppos + PCI_EXP_DEVCTL, &pctl);
585 } else 585 } else
586 goto bail; 586 goto bail;
587 /* Find out supported and configured values for endpoint (us) */ 587 /* Find out supported and configured values for endpoint (us) */
588 epos = pci_find_capability(dd->pcidev, PCI_CAP_ID_EXP); 588 epos = pci_pcie_cap(dd->pcidev);
589 if (epos) { 589 if (epos) {
590 pci_read_config_word(dd->pcidev, epos + PCI_EXP_DEVCAP, &ecaps); 590 pci_read_config_word(dd->pcidev, epos + PCI_EXP_DEVCAP, &ecaps);
591 pci_read_config_word(dd->pcidev, epos + PCI_EXP_DEVCTL, &ectl); 591 pci_read_config_word(dd->pcidev, epos + PCI_EXP_DEVCTL, &ectl);