Skip to content

Commit

Permalink
Input: wacom - properly enable runtime PM
Browse files Browse the repository at this point in the history
We need to always call usb_autopm_put_interface() in wacom_open(),
not only when initialization fails, otherwise the device will be
marked as PM-busy and will never be put in suspended state.

Based on patch by Oliver Neukum.

Acked-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Dmitry Torokhov committed Oct 18, 2010
1 parent 3136baf commit 62ecae0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/input/tablet/wacom_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,22 +120,25 @@ static int wacom_open(struct input_dev *dev)

out:
mutex_unlock(&wacom->lock);
if (retval)
usb_autopm_put_interface(wacom->intf);
usb_autopm_put_interface(wacom->intf);
return retval;
}

static void wacom_close(struct input_dev *dev)
{
struct wacom *wacom = input_get_drvdata(dev);
int autopm_error;

autopm_error = usb_autopm_get_interface(wacom->intf);

mutex_lock(&wacom->lock);
usb_kill_urb(wacom->irq);
wacom->open = false;
wacom->intf->needs_remote_wakeup = 0;
mutex_unlock(&wacom->lock);

usb_autopm_put_interface(wacom->intf);
if (!autopm_error)
usb_autopm_put_interface(wacom->intf);
}

static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hid_desc,
Expand Down

0 comments on commit 62ecae0

Please sign in to comment.