summaryrefslogtreecommitdiffstats
path: root/drivers/pci/quirks.c
diff options
context:
space:
mode:
authorYijing Wang <wangyijing@huawei.com>2013-06-18 10:22:14 +0200
committerBjorn Helgaas <bhelgaas@google.com>2013-06-18 20:05:34 +0200
commit728cdb7582a230234795619036d887d7f52bce1e (patch)
tree0de33c16dddda3b7e94d3657d27150ee20c24201 /drivers/pci/quirks.c
parentPCI / ACPI / PM: Use correct power state strings in messages (diff)
downloadlinux-728cdb7582a230234795619036d887d7f52bce1e.tar.xz
linux-728cdb7582a230234795619036d887d7f52bce1e.zip
PCI: Use pdev->pm_cap instead of pci_find_capability(..,PCI_CAP_ID_PM)
PCI PM cap register offset has been saved in pci_pm_init(), so we can use pdev->pm_cap instead of using pci_find_capability(..) here. Signed-off-by: Yijing Wang <wangyijing@huawei.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/pci/quirks.c')
-rw-r--r--drivers/pci/quirks.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 7f492574dcf4..dee5ed4f7b6e 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -1832,7 +1832,6 @@ static void quirk_e100_interrupt(struct pci_dev *dev)
u16 command, pmcsr;
u8 __iomem *csr;
u8 cmd_hi;
- int pm;
switch (dev->device) {
/* PCI IDs taken from drivers/net/e100.c */
@@ -1870,9 +1869,8 @@ static void quirk_e100_interrupt(struct pci_dev *dev)
* Check that the device is in the D0 power state. If it's not,
* there is no point to look any further.
*/
- pm = pci_find_capability(dev, PCI_CAP_ID_PM);
- if (pm) {
- pci_read_config_word(dev, pm + PCI_PM_CTRL, &pmcsr);
+ if (dev->pm_cap) {
+ pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr);
if ((pmcsr & PCI_PM_CTRL_STATE_MASK) != PCI_D0)
return;
}