Input: pegasus_notetaker - set device mode in reset_resume() if in use
authorMartin Kepplinger <martink@posteo.de>
Tue, 19 Jul 2016 21:31:12 +0000 (14:31 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 19 Jul 2016 21:33:07 +0000 (14:33 -0700)
Signed-off-by: Martin Kepplinger <martink@posteo.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/tablet/pegasus_notetaker.c

index 17770df37628e27a6b6452cf247880edf6782802..949dacc786649d2adb6b581b465a53b68cd2f24c 100644 (file)
@@ -410,7 +410,19 @@ static int pegasus_resume(struct usb_interface *intf)
 
 static int pegasus_reset_resume(struct usb_interface *intf)
 {
-       return pegasus_resume(intf);
+       struct pegasus *pegasus = usb_get_intfdata(intf);
+       int retval = 0;
+
+       mutex_lock(&pegasus->dev->mutex);
+       if (pegasus->dev->users) {
+               retval = pegasus_set_mode(pegasus, PEN_MODE_XY,
+                                         NOTETAKER_LED_MOUSE);
+               if (!retval && usb_submit_urb(pegasus->irq, GFP_NOIO) < 0)
+                       retval = -EIO;
+       }
+       mutex_unlock(&pegasus->dev->mutex);
+
+       return retval;
 }
 
 static const struct usb_device_id pegasus_ids[] = {