aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 3dcb83d7eb25..e179af3186f5 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -294,7 +294,7 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state)
294 return -EIO; 294 return -EIO;
295 295
296 pci_read_config_word(dev,pm + PCI_PM_PMC,&pmc); 296 pci_read_config_word(dev,pm + PCI_PM_PMC,&pmc);
297 if ((pmc & PCI_PM_CAP_VER_MASK) > 2) { 297 if ((pmc & PCI_PM_CAP_VER_MASK) > 3) {
298 printk(KERN_DEBUG 298 printk(KERN_DEBUG
299 "PCI: %s has unsupported PM cap regs version (%u)\n", 299 "PCI: %s has unsupported PM cap regs version (%u)\n",
300 pci_name(dev), pmc & PCI_PM_CAP_VER_MASK); 300 pci_name(dev), pmc & PCI_PM_CAP_VER_MASK);
@@ -302,12 +302,10 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state)
302 } 302 }
303 303
304 /* check if this device supports the desired state */ 304 /* check if this device supports the desired state */
305 if (state == PCI_D1 || state == PCI_D2) { 305 if (state == PCI_D1 && !(pmc & PCI_PM_CAP_D1))
306 if (state == PCI_D1 && !(pmc & PCI_PM_CAP_D1)) 306 return -EIO;
307 return -EIO; 307 else if (state == PCI_D2 && !(pmc & PCI_PM_CAP_D2))
308 else if (state == PCI_D2 && !(pmc & PCI_PM_CAP_D2)) 308 return -EIO;
309 return -EIO;
310 }
311 309
312 pci_read_config_word(dev, pm + PCI_PM_CTRL, &pmcsr); 310 pci_read_config_word(dev, pm + PCI_PM_CTRL, &pmcsr);
313 311