linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] input: Fix USB autosuspend on bcm5974
@ 2011-10-06 21:36 Matthew Garrett
  2011-10-06 22:38 ` Dmitry Torokhov
  0 siblings, 1 reply; 13+ messages in thread
From: Matthew Garrett @ 2011-10-06 21:36 UTC (permalink / raw)
  To: linux-input; +Cc: rydberg, dtor, Matthew Garrett

The bcm5974 code takes a USB autosuspend reference on device open but
only releases it if there's an error. Repeated opens will bump the count,
which is clearly wrong. It's also unnecessary - the only part of the
driver operation that is incompatible with autosuspend is the initial
setup, and after that the device generates appropriate remote wakeups.
Making the unreference unconditional fixes this.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
---
 drivers/input/mouse/bcm5974.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c
index 5ec617e..38d0286 100644
--- a/drivers/input/mouse/bcm5974.c
+++ b/drivers/input/mouse/bcm5974.c
@@ -764,8 +764,7 @@ static int bcm5974_open(struct input_dev *input)
 
 	mutex_unlock(&dev->pm_mutex);
 
-	if (error)
-		usb_autopm_put_interface(dev->intf);
+	usb_autopm_put_interface(dev->intf);
 
 	return error;
 }
-- 
1.7.6.4


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2011-10-07 19:20 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-06 21:36 [PATCH] input: Fix USB autosuspend on bcm5974 Matthew Garrett
2011-10-06 22:38 ` Dmitry Torokhov
2011-10-06 23:19   ` Matthew Garrett
2011-10-07  6:37     ` Oliver Neukum
2011-10-07 12:36       ` Matthew Garrett
2011-10-07 16:20         ` Dmitry Torokhov
2011-10-07 16:27           ` Matthew Garrett
2011-10-07 17:06             ` Henrik Rydberg
2011-10-07 17:13               ` Matthew Garrett
2011-10-07 17:42                 ` Henrik Rydberg
2011-10-07 17:39                   ` Matthew Garrett
2011-10-07 18:13                     ` Henrik Rydberg
2011-10-07 19:20                       ` Matthew Garrett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).