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 <[email protected]>
Reported-By: Benjamin Herrenschmidt <[email protected]>
Acked-by: Linus Torvalds <[email protected]>
Signed-off-by: Jesse Barnes <[email protected]>
This commit is contained in:
Rafael J. Wysocki 2009-02-04 01:57:22 +01:00 • committed by Jesse Barnes
commit 144a76bc88

View file

@ -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;
}
/**