summaryrefslogtreecommitdiff
path: root/drivers/pci/pcie/aer/ecrc.c
diff options
context:
space:
mode:
authorFrederick Lawler <fred@fredlawl.com>2018-03-23 00:20:55 +0300
committerBjorn Helgaas <helgaas@kernel.org>2018-03-31 01:26:59 +0300
commitf0553ba08a19031726f120448eedc3aff1599c23 (patch)
tree201fa5b774ff6878712f8cad042f2cf459c3a79e /drivers/pci/pcie/aer/ecrc.c
parentd850882b726f6db01b0792151e72e69b234aa461 (diff)
downloadlinux-f0553ba08a19031726f120448eedc3aff1599c23.tar.xz
PCI/AER: Use cached AER Capability offset
Replace pci_find_ext_capability(..., PCI_EXT_CAP_ID_ERR) calls with pci_dev->aer_cap. pci_dev->aer_cap is initialized in pci_init_capabilities(), which happens before any of these users of the AER Capability. Signed-off-by: Frederick Lawler <fred@fredlawl.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/pcie/aer/ecrc.c')
-rw-r--r--drivers/pci/pcie/aer/ecrc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pci/pcie/aer/ecrc.c b/drivers/pci/pcie/aer/ecrc.c
index 26d3cac9e635..afb5f761f5d4 100644
--- a/drivers/pci/pcie/aer/ecrc.c
+++ b/drivers/pci/pcie/aer/ecrc.c
@@ -40,7 +40,7 @@ static int enable_ecrc_checking(struct pci_dev *dev)
if (!pci_is_pcie(dev))
return -ENODEV;
- pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR);
+ pos = dev->aer_cap;
if (!pos)
return -ENODEV;
@@ -68,7 +68,7 @@ static int disable_ecrc_checking(struct pci_dev *dev)
if (!pci_is_pcie(dev))
return -ENODEV;
- pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR);
+ pos = dev->aer_cap;
if (!pos)
return -ENODEV;