All of lore.kernel.org
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@linux.vnet.ibm.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: rjw@sisk.pl
Subject: PCI: pci_restore_state() is returning 0 when it fails
Date: Fri, 13 Nov 2009 15:05:33 -0200	[thread overview]
Message-ID: <4AFD91DD.7000104@linux.vnet.ibm.com> (raw)

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


             reply	other threads:[~2009-11-13 17:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-13 17:05 Breno Leitao [this message]
2009-11-13 20:08 ` PCI: pci_restore_state() is returning 0 when it fails 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AFD91DD.7000104@linux.vnet.ibm.com \
    --to=leitao@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@sisk.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.