From: Jeff Garzik <jeff@garzik.org>
To: oakad@yahoo.com, Andrew Morton <akpm@osdl.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] drivers/{mmc,misc}: handle PCI errors on resume
Date: Wed, 11 Oct 2006 17:48:09 -0400 [thread overview]
Message-ID: <20061011214809.GA21756@havoc.gtf.org> (raw)
Since pci_enable_device() is one of the first things called in the
resume step, take the minimalist approach and return immediately, if
pci_enable_device() fails during resume.
Also, in sdhci: don't check for impossible condition (chip==NULL)
Signed-off-by: Jeff Garzik <jeff@garzik.org>
---
drivers/misc/tifm_7xx1.c | 7 ++++++-
drivers/mmc/sdhci.c | 11 +++++------
diff --git a/drivers/misc/tifm_7xx1.c b/drivers/misc/tifm_7xx1.c
index 1ba8754..03988b9 100644
--- a/drivers/misc/tifm_7xx1.c
+++ b/drivers/misc/tifm_7xx1.c
@@ -273,9 +273,14 @@ static int tifm_7xx1_resume(struct pci_d
{
struct tifm_adapter *fm = pci_get_drvdata(dev);
unsigned long flags;
+ int rc;
pci_restore_state(dev);
- pci_enable_device(dev);
+
+ rc = pci_enable_device(dev);
+ if (rc)
+ return rc;
+
pci_set_power_state(dev, PCI_D0);
pci_set_master(dev);
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 9a7d39b..b27fff9 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -1090,18 +1090,17 @@ static int sdhci_suspend (struct pci_dev
static int sdhci_resume (struct pci_dev *pdev)
{
- struct sdhci_chip *chip;
+ struct sdhci_chip *chip = pci_get_drvdata(pdev);
int i, ret;
- chip = pci_get_drvdata(pdev);
- if (!chip)
- return 0;
-
DBG("Resuming...\n");
pci_set_power_state(pdev, PCI_D0);
pci_restore_state(pdev);
- pci_enable_device(pdev);
+
+ ret = pci_enable_device(pdev);
+ if (ret)
+ return ret;
for (i = 0;i < chip->num_slots;i++) {
if (!chip->hosts[i])
next reply other threads:[~2006-10-11 21:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-11 21:48 Jeff Garzik [this message]
2006-10-13 8:00 ` Russell King
2006-10-21 10:24 ` Pierre Ossman
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=20061011214809.GA21756@havoc.gtf.org \
--to=jeff@garzik.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oakad@yahoo.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®