Commit 144a76bc authored by Rafael J. Wysocki's avatar Rafael J. Wysocki Committed by Jesse Barnes

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: default avatarRafael J. Wysocki <rjw@sisk.pl>
Reported-By: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent ddb7c9d2
......@@ -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;
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment