PCI PM: Fix hibernation breakage on EeePC 701
authorRafael J. Wysocki <rjw@sisk.pl>
Thu, 22 Jan 2009 22:36:56 +0000 (23:36 +0100)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Tue, 27 Jan 2009 17:46:27 +0000 (09:46 -0800)
Hibernation breaks on EeePC 701 as a result of attempting to put one
of its (driverless) devices into a low power state.  Avoid that by
not attepmting to power manage driverless devices during hibernation.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Reported-and-tested-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/pci/pci-driver.c

index 4884c48..ab1d615 100644 (file)
@@ -669,7 +669,10 @@ static int pci_pm_poweroff(struct device *dev)
        if (pci_has_legacy_pm_support(pci_dev))
                return pci_legacy_suspend(dev, PMSG_HIBERNATE);
 
-       if (drv && drv->pm && drv->pm->poweroff) {
+       if (!drv || !drv->pm)
+               return 0;
+
+       if (drv->pm->poweroff) {
                error = drv->pm->poweroff(dev);
                suspend_report_result(drv->pm->poweroff, error);
        }