]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
PCI: fix incorrect error return in pci_enable_wake
authorAlan Stern <stern@rowland.harvard.edu>
Tue, 16 Dec 2008 19:06:58 +0000 (14:06 -0500)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Wed, 7 Jan 2009 19:12:56 +0000 (11:12 -0800)
This patch (as1186) fixes a minor mistake in pci_enable_wake().  When
the routine is asked to disable remote wakeup, it should not return an
error merely because the device is not allowed to do wakeups!

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/pci/pci.c

index d4d71fae623352143a5691e72c25871bc6684818..1fb7cff4cdaedb86443912be8d70b327cac653c4 100644 (file)
@@ -1091,7 +1091,7 @@ int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable)
        int error = 0;
        bool pme_done = false;
 
-       if (!device_may_wakeup(&dev->dev))
+       if (enable && !device_may_wakeup(&dev->dev))
                return -EINVAL;
 
        /*