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-Url: https://git.stricted.de/?a=commitdiff_plain;h=bebd590ca27e80ffe3129ab4f0a3124f0a340f43;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.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 d4d71fae6233..1fb7cff4cdae 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; /*