From: Alan Stern Date: Tue, 16 Dec 2008 19:06:58 +0000 (-0500) Subject: PCI: fix incorrect error return in pci_enable_wake X-Git-Tag: v2.6.29-rc1~181^2~52 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=bebd590ca27e80ffe3129ab4f0a3124f0a340f43;p=linux-2.6-omap-h63xx.git PCI: fix incorrect error return in pci_enable_wake 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 Acked-by: Rafael J. Wysocki Signed-off-by: Jesse Barnes --- diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index d4d71fae623..1fb7cff4cda 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -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; /*