Skip to content

Commit

Permalink
PCI PM: Check if the state has been saved before trying to restore it
Browse files Browse the repository at this point in the history
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 <rjw@sisk.pl>
Reported-By: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
  • Loading branch information
Rafael J. Wysocki authored and Jesse Barnes committed Feb 5, 2009
1 parent ddb7c9d commit 144a76b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 144a76b

Please sign in to comment.