aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/pci.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 35fa30aa3065..03fd59e80fef 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -406,6 +406,13 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state)
406 if ((state == PCI_D1 || state == PCI_D2) && pci_no_d1d2(dev)) 406 if ((state == PCI_D1 || state == PCI_D2) && pci_no_d1d2(dev))
407 return 0; 407 return 0;
408 408
409 /* find PCI PM capability in list */
410 pm = pci_find_capability(dev, PCI_CAP_ID_PM);
411
412 /* abort if the device doesn't support PM capabilities */
413 if (!pm)
414 return -EIO;
415
409 /* Validate current state: 416 /* Validate current state:
410 * Can enter D0 from any state, but if we can only go deeper 417 * Can enter D0 from any state, but if we can only go deeper
411 * to sleep if we're already in a low power state 418 * to sleep if we're already in a low power state
@@ -418,13 +425,6 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state)
418 return 0; /* we're already there */ 425 return 0; /* we're already there */
419 426
420 427
421 /* find PCI PM capability in list */
422 pm = pci_find_capability(dev, PCI_CAP_ID_PM);
423
424 /* abort if the device doesn't support PM capabilities */
425 if (!pm)
426 return -EIO;
427
428 pci_read_config_word(dev,pm + PCI_PM_PMC,&pmc); 428 pci_read_config_word(dev,pm + PCI_PM_PMC,&pmc);
429 if ((pmc & PCI_PM_CAP_VER_MASK) > 3) { 429 if ((pmc & PCI_PM_CAP_VER_MASK) > 3) {
430 printk(KERN_DEBUG 430 printk(KERN_DEBUG