Skip to content

Commit

Permalink
Input: pegasus_notetaker - set device mode in reset_resume() if in use
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Kepplinger <martink@posteo.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Martin Kepplinger authored and Dmitry Torokhov committed Jul 19, 2016
1 parent f32f539 commit c1d7b7c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion drivers/input/tablet/pegasus_notetaker.c
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = {
Expand Down

0 comments on commit c1d7b7c

Please sign in to comment.