Skip to content

Commit 62ecae0

Browse files
committed
Input: wacom - properly enable runtime PM
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>
1 parent 3136baf commit 62ecae0

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎drivers/input/tablet/wacom_sys.c‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,22 +120,25 @@ static int wacom_open(struct input_dev *dev)
120120

121121
out:
122122
mutex_unlock(&wacom->lock);
123-
if (retval)
124-
usb_autopm_put_interface(wacom->intf);
123+
usb_autopm_put_interface(wacom->intf);
125124
return retval;
126125
}
127126

128127
static void wacom_close(struct input_dev *dev)
129128
{
130129
struct wacom *wacom = input_get_drvdata(dev);
130+
int autopm_error;
131+
132+
autopm_error = usb_autopm_get_interface(wacom->intf);
131133

132134
mutex_lock(&wacom->lock);
133135
usb_kill_urb(wacom->irq);
134136
wacom->open = false;
135137
wacom->intf->needs_remote_wakeup = 0;
136138
mutex_unlock(&wacom->lock);
137139

138-
usb_autopm_put_interface(wacom->intf);
140+
if (!autopm_error)
141+
usb_autopm_put_interface(wacom->intf);
139142
}
140143

141144
static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hid_desc,

0 commit comments

Comments
 (0)