Net / e100: Fix suspend of devices that cannot be power managed

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, June 18, 2009 - 3:03 pm

Gitweb:     http://git.kernel.org/linus/6905b1f1a03a48dcf115a2927f7b87dba8d5e566
Commit:     6905b1f1a03a48dcf115a2927f7b87dba8d5e566
Parent:     ab0a8e6c663047363e7436621b66c2ae575d2525
Author:     Rafael J. Wysocki <rjw@sisk.pl>
AuthorDate: Sun Jun 14 09:46:46 2009 +0000
Committer:  David S. Miller <davem@davemloft.net>
CommitDate: Thu Jun 18 00:29:10 2009 -0700

    Net / e100: Fix suspend of devices that cannot be power managed
    
    If the adapter is not power-manageable using either ACPI, or the
    native PCI PM interface, __e100_power_off() returns error code, which
    causes every attempt to suspend to fail, although it should return 0
    in such a case.  Fix this problem by ignoring the return value of
    pci_set_power_state() in __e100_power_off().
    
    Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
    Acked-by: Andreas Mohr <andi@lisas.de>
    Signed-off-by: David S. Miller <davem@davemloft.net>
---
 drivers/net/e100.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index f7929e8..efa680f 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -2895,12 +2895,13 @@ static void __e100_shutdown(struct pci_dev *pdev, bool *enable_wake)
 
 static int __e100_power_off(struct pci_dev *pdev, bool wake)
 {
-	if (wake) {
+	if (wake)
 		return pci_prepare_to_sleep(pdev);
-	} else {
-		pci_wake_from_d3(pdev, false);
-		return pci_set_power_state(pdev, PCI_D3hot);
-	}
+
+	pci_wake_from_d3(pdev, false);
+	pci_set_power_state(pdev, PCI_D3hot);
+
+	return 0;
 }
 
 #ifdef CONFIG_PM
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Net / e100: Fix suspend of devices that cannot be power ma ..., Linux Kernel Mailing ..., (Thu Jun 18, 3:03 pm)