diff options
author | Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> | 2009-11-11 00:31:38 -0500 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-11-24 18:25:13 -0500 |
commit | 39a53062cb5b2ceca6035f3ed67317672f0bcf3b (patch) | |
tree | cafbfa800f85c28abad3504787555009ebd97dd0 /drivers/pci | |
parent | 06a1cbafb253c4c60d6a54a994887f5fbceabcc0 (diff) |
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')
-rw-r--r-- | drivers/pci/pcie/aer/aerdrv.c | 2 | ||||
-rw-r--r-- | drivers/pci/pcie/aer/aerdrv_core.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/drivers/pci/pcie/aer/aerdrv.c b/drivers/pci/pcie/aer/aerdrv.c index 40c3cc5d1caf..6d30e795a10d 100644 --- a/drivers/pci/pcie/aer/aerdrv.c +++ b/drivers/pci/pcie/aer/aerdrv.c | |||
@@ -295,7 +295,7 @@ static void aer_error_resume(struct pci_dev *dev) | |||
295 | u16 reg16; | 295 | u16 reg16; |
296 | 296 | ||
297 | /* Clean up Root device status */ | 297 | /* Clean up Root device status */ |
298 | pos = pci_find_capability(dev, PCI_CAP_ID_EXP); | 298 | pos = pci_pcie_cap(dev); |
299 | pci_read_config_word(dev, pos + PCI_EXP_DEVSTA, ®16); | 299 | pci_read_config_word(dev, pos + PCI_EXP_DEVSTA, ®16); |
300 | pci_write_config_word(dev, pos + PCI_EXP_DEVSTA, reg16); | 300 | pci_write_config_word(dev, pos + PCI_EXP_DEVSTA, reg16); |
301 | 301 | ||
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) | |||
42 | if (!pos) | 42 | if (!pos) |
43 | return -EIO; | 43 | return -EIO; |
44 | 44 | ||
45 | pos = pci_find_capability(dev, PCI_CAP_ID_EXP); | 45 | pos = pci_pcie_cap(dev); |
46 | if (!pos) | 46 | if (!pos) |
47 | return -EIO; | 47 | return -EIO; |
48 | 48 | ||
@@ -66,7 +66,7 @@ int pci_disable_pcie_error_reporting(struct pci_dev *dev) | |||
66 | if (dev->aer_firmware_first) | 66 | if (dev->aer_firmware_first) |
67 | return -EIO; | 67 | return -EIO; |
68 | 68 | ||
69 | pos = pci_find_capability(dev, PCI_CAP_ID_EXP); | 69 | pos = pci_pcie_cap(dev); |
70 | if (!pos) | 70 | if (!pos) |
71 | return -EIO; | 71 | return -EIO; |
72 | 72 | ||
@@ -224,7 +224,7 @@ static int find_device_iter(struct pci_dev *dev, void *data) | |||
224 | */ | 224 | */ |
225 | if (atomic_read(&dev->enable_cnt) == 0) | 225 | if (atomic_read(&dev->enable_cnt) == 0) |
226 | return 0; | 226 | return 0; |
227 | pos = pci_find_capability(dev, PCI_CAP_ID_EXP); | 227 | pos = pci_pcie_cap(dev); |
228 | if (!pos) | 228 | if (!pos) |
229 | return 0; | 229 | return 0; |
230 | /* Check if AER is enabled */ | 230 | /* Check if AER is enabled */ |
@@ -618,7 +618,7 @@ void aer_enable_rootport(struct aer_rpc *rpc) | |||
618 | u16 reg16; | 618 | u16 reg16; |
619 | u32 reg32; | 619 | u32 reg32; |
620 | 620 | ||
621 | pos = pci_find_capability(pdev, PCI_CAP_ID_EXP); | 621 | pos = pci_pcie_cap(pdev); |
622 | /* Clear PCIE Capability's Device Status */ | 622 | /* Clear PCIE Capability's Device Status */ |
623 | pci_read_config_word(pdev, pos+PCI_EXP_DEVSTA, ®16); | 623 | pci_read_config_word(pdev, pos+PCI_EXP_DEVSTA, ®16); |
624 | pci_write_config_word(pdev, pos+PCI_EXP_DEVSTA, reg16); | 624 | pci_write_config_word(pdev, pos+PCI_EXP_DEVSTA, reg16); |