Skip to contentSkip to conversation

PCI: fix incorrect error return in pci_enable_wake

PATCH New Alan Stern 4 participants 5 messages Dec 11, 2008 – Dec 16, 2008 3 messages not in the archive PCI

lore
Share & tools
lore

Alan Stern

author
#1 lore raw

PATCH 1/1 PCI: fix incorrect error return in pci_enable_wake

In reply to a message not in the archive

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!

---

drivers/pci/pci.c +1 -1
Index: usb-2.6/drivers/pci/pci.c
===================================================================
@@ -1107,7 +1107,7 @@ int pci_enable_wake(struct pci_dev *dev,
 	int error = 0;
 	bool pme_done = false;
 
-	if (!device_may_wakeup(&dev->dev))
+	if (enable && !device_may_wakeup(&dev->dev))
 		return -EINVAL;
 
 	/*
#3 lore raw
In reply to a message not in the archive
Quoted 5 lines · Alan Stern

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!

[This should go to Jesse, BTW, already CCed.]

Quoted 15 lines

---

Index: usb-2.6/drivers/pci/pci.c
===================================================================

drivers/pci/pci.c +1 -1
@@ -1107,7 +1107,7 @@ int pci_enable_wake(struct pci_dev *dev,
 	int error = 0;
 	bool pme_done = false;
 
-	if (!device_may_wakeup(&dev->dev))
+	if (enable && !device_may_wakeup(&dev->dev))
 		return -EINVAL;
 
 	/*
Acked-by
#4 lore raw
In reply to a message not in the archive
Quoted 5 lines · Alan Stern

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!

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#6 lore raw
In reply to a message not in the archive
Quoted 8 lines · Rafael J. Wysocki
Quoted 5 lines · Alan Stern

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!

I lost the original of this one. Alan can you resend to me with Rafael's ack?

Thanks,

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
author Acked-by Rafael J. Wysocki
#7 lore raw

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!

---

Quoted 1 line · Jesse Barnes

I lost the original of this one. Alan can you resend to me with Rafael's ack?

Here you go.

Alan Stern

drivers/pci/pci.c +1 -1
Index: usb-2.6/drivers/pci/pci.c
===================================================================
@@ -1107,7 +1107,7 @@ int pci_enable_wake(struct pci_dev *dev,
 	int error = 0;
 	bool pme_done = false;
 
-	if (!device_may_wakeup(&dev->dev))
+	if (enable && !device_may_wakeup(&dev->dev))
 		return -EINVAL;
 
 	/*