diff options
-rw-r--r-- | drivers/pci/pci.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index f0ef3997ed3b..a899d8bb190d 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -646,15 +646,11 @@ static int pci_platform_power_transition(struct pci_dev *dev, pci_power_t state) | |||
646 | error = platform_pci_set_power_state(dev, state); | 646 | error = platform_pci_set_power_state(dev, state); |
647 | if (!error) | 647 | if (!error) |
648 | pci_update_current_state(dev, state); | 648 | pci_update_current_state(dev, state); |
649 | /* Fall back to PCI_D0 if native PM is not supported */ | 649 | } else |
650 | if (!dev->pm_cap) | ||
651 | dev->current_state = PCI_D0; | ||
652 | } else { | ||
653 | error = -ENODEV; | 650 | error = -ENODEV; |
654 | /* Fall back to PCI_D0 if native PM is not supported */ | 651 | |
655 | if (!dev->pm_cap) | 652 | if (error && !dev->pm_cap) /* Fall back to PCI_D0 */ |
656 | dev->current_state = PCI_D0; | 653 | dev->current_state = PCI_D0; |
657 | } | ||
658 | 654 | ||
659 | return error; | 655 | return error; |
660 | } | 656 | } |
@@ -1575,7 +1571,7 @@ void pci_pme_active(struct pci_dev *dev, bool enable) | |||
1575 | { | 1571 | { |
1576 | u16 pmcsr; | 1572 | u16 pmcsr; |
1577 | 1573 | ||
1578 | if (!dev->pm_cap) | 1574 | if (!dev->pme_support) |
1579 | return; | 1575 | return; |
1580 | 1576 | ||
1581 | pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr); | 1577 | pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr); |
@@ -1924,6 +1920,7 @@ void pci_pm_init(struct pci_dev *dev) | |||
1924 | dev->wakeup_prepared = false; | 1920 | dev->wakeup_prepared = false; |
1925 | 1921 | ||
1926 | dev->pm_cap = 0; | 1922 | dev->pm_cap = 0; |
1923 | dev->pme_support = 0; | ||
1927 | 1924 | ||
1928 | /* find PCI PM capability in list */ | 1925 | /* find PCI PM capability in list */ |
1929 | pm = pci_find_capability(dev, PCI_CAP_ID_PM); | 1926 | pm = pci_find_capability(dev, PCI_CAP_ID_PM); |
@@ -1975,8 +1972,6 @@ void pci_pm_init(struct pci_dev *dev) | |||
1975 | device_set_wakeup_capable(&dev->dev, true); | 1972 | device_set_wakeup_capable(&dev->dev, true); |
1976 | /* Disable the PME# generation functionality */ | 1973 | /* Disable the PME# generation functionality */ |
1977 | pci_pme_active(dev, false); | 1974 | pci_pme_active(dev, false); |
1978 | } else { | ||
1979 | dev->pme_support = 0; | ||
1980 | } | 1975 | } |
1981 | } | 1976 | } |
1982 | 1977 | ||