aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci-driver.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2009-01-07 07:02:36 -0500
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-01-07 14:14:07 -0500
commitc9b9972b3c88272be02d971346285d1c67fbb95f (patch)
tree9e7e942bb3f36de15a4c953d03d87c0a01e185c7 /drivers/pci/pci-driver.c
parent987a4c783a8bbf3baf554e6b8ff588b26e06e020 (diff)
PCI PM: Fix poweroff and restore callbacks
pci_fixup_device() is called too early in pci_pm_poweroff() and too late in pci_pm_restore(). Moreover, pci_pm_restore_noirq() calls pci_fixup_device() twice and in a wrong way. Fix that. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/pci-driver.c')
-rw-r--r--drivers/pci/pci-driver.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index c3f76be832d4..23bdf64411e5 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -611,8 +611,6 @@ static int pci_pm_poweroff(struct device *dev)
611 struct device_driver *drv = dev->driver; 611 struct device_driver *drv = dev->driver;
612 int error = 0; 612 int error = 0;
613 613
614 pci_fixup_device(pci_fixup_suspend, pci_dev);
615
616 if (drv && drv->pm) { 614 if (drv && drv->pm) {
617 if (drv->pm->poweroff) { 615 if (drv->pm->poweroff) {
618 error = drv->pm->poweroff(dev); 616 error = drv->pm->poweroff(dev);
@@ -622,6 +620,8 @@ static int pci_pm_poweroff(struct device *dev)
622 error = pci_legacy_suspend(dev, PMSG_HIBERNATE); 620 error = pci_legacy_suspend(dev, PMSG_HIBERNATE);
623 } 621 }
624 622
623 pci_fixup_device(pci_fixup_suspend, pci_dev);
624
625 return error; 625 return error;
626} 626}
627 627
@@ -648,6 +648,8 @@ static int pci_pm_restore(struct device *dev)
648 struct device_driver *drv = dev->driver; 648 struct device_driver *drv = dev->driver;
649 int error = 0; 649 int error = 0;
650 650
651 pci_fixup_device(pci_fixup_resume, pci_dev);
652
651 if (drv && drv->pm) { 653 if (drv && drv->pm) {
652 if (drv->pm->restore) 654 if (drv->pm->restore)
653 error = drv->pm->restore(dev); 655 error = drv->pm->restore(dev);
@@ -656,7 +658,6 @@ static int pci_pm_restore(struct device *dev)
656 } else { 658 } else {
657 error = pci_default_pm_resume_late(pci_dev); 659 error = pci_default_pm_resume_late(pci_dev);
658 } 660 }
659 pci_fixup_device(pci_fixup_resume, pci_dev);
660 661
661 return error; 662 return error;
662} 663}
@@ -667,7 +668,7 @@ static int pci_pm_restore_noirq(struct device *dev)
667 struct device_driver *drv = dev->driver; 668 struct device_driver *drv = dev->driver;
668 int error = 0; 669 int error = 0;
669 670
670 pci_fixup_device(pci_fixup_resume, pci_dev); 671 pci_fixup_device(pci_fixup_resume_early, pci_dev);
671 672
672 if (drv && drv->pm) { 673 if (drv && drv->pm) {
673 if (drv->pm->restore_noirq) 674 if (drv->pm->restore_noirq)
@@ -677,7 +678,6 @@ static int pci_pm_restore_noirq(struct device *dev)
677 } else { 678 } else {
678 pci_default_pm_resume_early(pci_dev); 679 pci_default_pm_resume_early(pci_dev);
679 } 680 }
680 pci_fixup_device(pci_fixup_resume_early, pci_dev);
681 681
682 return error; 682 return error;
683} 683}