public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* PCI: pci_restore_state() is returning 0 when it fails
@ 2009-11-13 17:05 Breno Leitao
  2009-11-13 20:08 ` Rafael J. Wysocki
  0 siblings, 1 reply; 6+ messages in thread
From: Breno Leitao @ 2009-11-13 17:05 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: rjw

Actually pci_restore_state() is returning 0 if the restore process
fails, instead of a error value.

If it fails, I believe that it should return -EPERM, once that
it is an invalid operation and probably pci_save_state() wasn't
called.

Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
---
 drivers/pci/pci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 4e4c295..b677ca3 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -857,7 +857,7 @@ pci_restore_state(struct pci_dev *dev)
 	u32 val;
 
 	if (!dev->state_saved)
-		return 0;
+		return -EPERM;
 
 	/* PCI Express register must be restored first */
 	pci_restore_pcie_state(dev);
-- 
1.6.0.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-11-23 19:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-13 17:05 PCI: pci_restore_state() is returning 0 when it fails Breno Leitao
2009-11-13 20:08 ` Rafael J. Wysocki
2009-11-16 14:13   ` Breno Leitao
2009-11-16 14:49     ` Ben Hutchings
2009-11-23 12:38       ` Breno Leitao
2009-11-23 19:29         ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox