From: Rafael J. Wysocki Date: Wed, 4 Feb 2009 00:57:22 +0000 (+0100) Subject: PCI PM: Check if the state has been saved before trying to restore it X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=144a76bc885ef4852601c66595326e59f12877f8;p=linux-2.6-omap-h63xx.git PCI PM: Check if the state has been saved before trying to restore it Check if the standard configuration registers of a PCI device have been saved during suspend before trying to restore them during resume. Signed-off-by: Rafael J. Wysocki Reported-By: Benjamin Herrenschmidt Acked-by: Linus Torvalds Signed-off-by: Jesse Barnes --- diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 48807556b47..87c904233bf 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -1421,7 +1421,7 @@ int pci_restore_standard_config(struct pci_dev *dev) dev->current_state = PCI_D0; Restore: - return pci_restore_state(dev); + return dev->state_saved ? pci_restore_state(dev) : 0; } /**