linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Garrett <mjg@redhat.com>
To: linux-input@vger.kernel.org
Cc: rydberg@euromail.se, dtor@mail.ru, Matthew Garrett <mjg@redhat.com>
Subject: [PATCH] input: Fix USB autosuspend on bcm5974
Date: Thu,  6 Oct 2011 17:36:37 -0400	[thread overview]
Message-ID: <1317936997-20438-1-git-send-email-mjg@redhat.com> (raw)

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


             reply	other threads:[~2011-10-06 21:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-06 21:36 Matthew Garrett [this message]
2011-10-06 22:38 ` [PATCH] input: Fix USB autosuspend on bcm5974 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1317936997-20438-1-git-send-email-mjg@redhat.com \
    --to=mjg@redhat.com \
    --cc=dtor@mail.ru \
    --cc=linux-input@vger.kernel.org \
    --cc=rydberg@euromail.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).