summaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2009-01-07 13:02:36 +0100
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-01-07 11:14:07 -0800
commitc9b9972b3c88272be02d971346285d1c67fbb95f (patch)
tree9e7e942bb3f36de15a4c953d03d87c0a01e185c7 /drivers/pci
parent987a4c783a8bbf3baf554e6b8ff588b26e06e020 (diff)
downloadop-kernel-dev-c9b9972b3c88272be02d971346285d1c67fbb95f.zip
op-kernel-dev-c9b9972b3c88272be02d971346285d1c67fbb95f.tar.gz
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')
-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 c3f76be..23bdf64 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)
struct device_driver *drv = dev->driver;
int error = 0;
- pci_fixup_device(pci_fixup_suspend, pci_dev);
-
if (drv && drv->pm) {
if (drv->pm->poweroff) {
error = drv->pm->poweroff(dev);
@@ -622,6 +620,8 @@ static int pci_pm_poweroff(struct device *dev)
error = pci_legacy_suspend(dev, PMSG_HIBERNATE);
}
+ pci_fixup_device(pci_fixup_suspend, pci_dev);
+
return error;
}
@@ -648,6 +648,8 @@ static int pci_pm_restore(struct device *dev)
struct device_driver *drv = dev->driver;
int error = 0;
+ pci_fixup_device(pci_fixup_resume, pci_dev);
+
if (drv && drv->pm) {
if (drv->pm->restore)
error = drv->pm->restore(dev);
@@ -656,7 +658,6 @@ static int pci_pm_restore(struct device *dev)
} else {
error = pci_default_pm_resume_late(pci_dev);
}
- pci_fixup_device(pci_fixup_resume, pci_dev);
return error;
}
@@ -667,7 +668,7 @@ static int pci_pm_restore_noirq(struct device *dev)
struct device_driver *drv = dev->driver;
int error = 0;
- pci_fixup_device(pci_fixup_resume, pci_dev);
+ pci_fixup_device(pci_fixup_resume_early, pci_dev);
if (drv && drv->pm) {
if (drv->pm->restore_noirq)
@@ -677,7 +678,6 @@ static int pci_pm_restore_noirq(struct device *dev)
} else {
pci_default_pm_resume_early(pci_dev);
}
- pci_fixup_device(pci_fixup_resume_early, pci_dev);
return error;
}
OpenPOWER on IntegriCloud