Skip to content

Commit

Permalink
PCI: fix incorrect error return in pci_enable_wake
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alan Stern authored and Jesse Barnes committed Jan 7, 2009
1 parent f0e88af commit bebd590
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/*
Expand Down

0 comments on commit bebd590

Please sign in to comment.