diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 3dcb83d7eb250c5171ff5eb7cb9cc1c410ae09ed..e179af3186f56b8298faee43d8106516de349d3c 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) return -EIO; pci_read_config_word(dev,pm + PCI_PM_PMC,&pmc); - if ((pmc & PCI_PM_CAP_VER_MASK) > 2) { + if ((pmc & PCI_PM_CAP_VER_MASK) > 3) { printk(KERN_DEBUG "PCI: %s has unsupported PM cap regs version (%u)\n", 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) } /* check if this device supports the desired state */ - if (state == PCI_D1 || state == PCI_D2) { - if (state == PCI_D1 && !(pmc & PCI_PM_CAP_D1)) - return -EIO; - else if (state == PCI_D2 && !(pmc & PCI_PM_CAP_D2)) - return -EIO; - } + if (state == PCI_D1 && !(pmc & PCI_PM_CAP_D1)) + return -EIO; + else if (state == PCI_D2 && !(pmc & PCI_PM_CAP_D2)) + return -EIO; pci_read_config_word(dev, pm + PCI_PM_CTRL, &pmcsr); diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 4be1b887ab62831014e9ba4f6ea2014ddd169651..b9c9b03919d449ff967f7359bbd6049fe15c0dc4 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -584,7 +584,7 @@ static int pci_setup_device(struct pci_dev * dev) dev->vendor, dev->device, class, dev->hdr_type); /* "Unknown power state" */ - dev->current_state = 4; + dev->current_state = PCI_UNKNOWN; /* Early fixups, before probing the BARs */ pci_fixup_device(pci_fixup_early, dev); diff --git a/include/linux/pci.h b/include/linux/pci.h index b0e244713281c379ee646334a7146fb5d941f329..7004dde7fef0732c48b49dccc487e1d5854b92d2 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -75,6 +75,7 @@ typedef int __bitwise pci_power_t; #define PCI_D2 ((pci_power_t __force) 2) #define PCI_D3hot ((pci_power_t __force) 3) #define PCI_D3cold ((pci_power_t __force) 4) +#define PCI_UNKNOWN ((pci_power_t __force) 5) #define PCI_POWER_ERROR ((pci_power_t __force) -1) /*