diff options
author | Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> | 2009-11-11 08:31:38 +0300 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-11-25 02:25:13 +0300 |
commit | 39a53062cb5b2ceca6035f3ed67317672f0bcf3b (patch) | |
tree | cafbfa800f85c28abad3504787555009ebd97dd0 /drivers/pci/pcie/aer/aerdrv_core.c | |
parent | 06a1cbafb253c4c60d6a54a994887f5fbceabcc0 (diff) | |
download | linux-39a53062cb5b2ceca6035f3ed67317672f0bcf3b.tar.xz |
PCIe AER: use pci_pcie_cap()
Use pcie_cap() instead of pci_find_capability() to get PCIe capability
offset in PCIe AER driver. This avoids unnecessary search in PCI
configuration space.
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/pcie/aer/aerdrv_core.c')
-rw-r--r-- | drivers/pci/pcie/aer/aerdrv_core.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c index f4512feac12b..5391a9b412e5 100644 --- a/drivers/pci/pcie/aer/aerdrv_core.c +++ b/drivers/pci/pcie/aer/aerdrv_core.c @@ -42,7 +42,7 @@ int pci_enable_pcie_error_reporting(struct pci_dev *dev) if (!pos) return -EIO; - pos = pci_find_capability(dev, PCI_CAP_ID_EXP); + pos = pci_pcie_cap(dev); if (!pos) return -EIO; @@ -66,7 +66,7 @@ int pci_disable_pcie_error_reporting(struct pci_dev *dev) if (dev->aer_firmware_first) return -EIO; - pos = pci_find_capability(dev, PCI_CAP_ID_EXP); + pos = pci_pcie_cap(dev); if (!pos) return -EIO; @@ -224,7 +224,7 @@ static int find_device_iter(struct pci_dev *dev, void *data) */ if (atomic_read(&dev->enable_cnt) == 0) return 0; - pos = pci_find_capability(dev, PCI_CAP_ID_EXP); + pos = pci_pcie_cap(dev); if (!pos) return 0; /* Check if AER is enabled */ @@ -618,7 +618,7 @@ void aer_enable_rootport(struct aer_rpc *rpc) u16 reg16; u32 reg32; - pos = pci_find_capability(pdev, PCI_CAP_ID_EXP); + pos = pci_pcie_cap(pdev); /* Clear PCIE Capability's Device Status */ pci_read_config_word(pdev, pos+PCI_EXP_DEVSTA, ®16); pci_write_config_word(pdev, pos+PCI_EXP_DEVSTA, reg16); |