diff options
-rw-r--r-- | drivers/pci/pci-driver.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index 3c1831c82f5b..267de88551c9 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c | |||
@@ -516,13 +516,13 @@ static int pci_pm_suspend(struct device *dev) | |||
516 | if (pci_has_legacy_pm_support(pci_dev)) | 516 | if (pci_has_legacy_pm_support(pci_dev)) |
517 | return pci_legacy_suspend(dev, PMSG_SUSPEND); | 517 | return pci_legacy_suspend(dev, PMSG_SUSPEND); |
518 | 518 | ||
519 | pci_dev->state_saved = false; | ||
520 | |||
519 | if (!pm) { | 521 | if (!pm) { |
520 | pci_pm_default_suspend(pci_dev); | 522 | pci_pm_default_suspend(pci_dev); |
521 | goto Fixup; | 523 | goto Fixup; |
522 | } | 524 | } |
523 | 525 | ||
524 | pci_dev->state_saved = false; | ||
525 | |||
526 | if (pm->suspend) { | 526 | if (pm->suspend) { |
527 | pci_power_t prev = pci_dev->current_state; | 527 | pci_power_t prev = pci_dev->current_state; |
528 | int error; | 528 | int error; |
@@ -554,8 +554,10 @@ static int pci_pm_suspend_noirq(struct device *dev) | |||
554 | if (pci_has_legacy_pm_support(pci_dev)) | 554 | if (pci_has_legacy_pm_support(pci_dev)) |
555 | return pci_legacy_suspend_late(dev, PMSG_SUSPEND); | 555 | return pci_legacy_suspend_late(dev, PMSG_SUSPEND); |
556 | 556 | ||
557 | if (!pm) | 557 | if (!pm) { |
558 | pci_save_state(pci_dev); | ||
558 | return 0; | 559 | return 0; |
560 | } | ||
559 | 561 | ||
560 | if (pm->suspend_noirq) { | 562 | if (pm->suspend_noirq) { |
561 | pci_power_t prev = pci_dev->current_state; | 563 | pci_power_t prev = pci_dev->current_state; |
@@ -650,13 +652,13 @@ static int pci_pm_freeze(struct device *dev) | |||
650 | if (pci_has_legacy_pm_support(pci_dev)) | 652 | if (pci_has_legacy_pm_support(pci_dev)) |
651 | return pci_legacy_suspend(dev, PMSG_FREEZE); | 653 | return pci_legacy_suspend(dev, PMSG_FREEZE); |
652 | 654 | ||
655 | pci_dev->state_saved = false; | ||
656 | |||
653 | if (!pm) { | 657 | if (!pm) { |
654 | pci_pm_default_suspend(pci_dev); | 658 | pci_pm_default_suspend(pci_dev); |
655 | return 0; | 659 | return 0; |
656 | } | 660 | } |
657 | 661 | ||
658 | pci_dev->state_saved = false; | ||
659 | |||
660 | if (pm->freeze) { | 662 | if (pm->freeze) { |
661 | int error; | 663 | int error; |
662 | 664 | ||
@@ -738,13 +740,13 @@ static int pci_pm_poweroff(struct device *dev) | |||
738 | if (pci_has_legacy_pm_support(pci_dev)) | 740 | if (pci_has_legacy_pm_support(pci_dev)) |
739 | return pci_legacy_suspend(dev, PMSG_HIBERNATE); | 741 | return pci_legacy_suspend(dev, PMSG_HIBERNATE); |
740 | 742 | ||
743 | pci_dev->state_saved = false; | ||
744 | |||
741 | if (!pm) { | 745 | if (!pm) { |
742 | pci_pm_default_suspend(pci_dev); | 746 | pci_pm_default_suspend(pci_dev); |
743 | goto Fixup; | 747 | goto Fixup; |
744 | } | 748 | } |
745 | 749 | ||
746 | pci_dev->state_saved = false; | ||
747 | |||
748 | if (pm->poweroff) { | 750 | if (pm->poweroff) { |
749 | int error; | 751 | int error; |
750 | 752 | ||