Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/dtor/input

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: wacom - fix runtime PM related deadlock
  Input: joydev - fix JSIOCSAXMAP ioctl
  Input: uinput - setup MT usage during device creation
  • Loading branch information
Linus Torvalds committed Oct 7, 2010
2 parents 5710c2b + f6cd378 commit afe1474
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
3 changes: 3 additions & 0 deletions drivers/input/joydev.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,9 @@ static int joydev_handle_JSIOCSAXMAP(struct joydev *joydev,

memcpy(joydev->abspam, abspam, len);

for (i = 0; i < joydev->nabs; i++)
joydev->absmap[joydev->abspam[i]] = i;

out:
kfree(abspam);
return retval;
Expand Down
7 changes: 7 additions & 0 deletions drivers/input/misc/uinput.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,13 @@ static int uinput_setup_device(struct uinput_device *udev, const char __user *bu
retval = uinput_validate_absbits(dev);
if (retval < 0)
goto exit;
if (test_bit(ABS_MT_SLOT, dev->absbit)) {
int nslot = input_abs_get_max(dev, ABS_MT_SLOT) + 1;
input_mt_create_slots(dev, nslot);
input_set_events_per_packet(dev, 6 * nslot);
} else if (test_bit(ABS_MT_POSITION_X, dev->absbit)) {
input_set_events_per_packet(dev, 60);
}
}

udev->state = UIST_SETUP_COMPLETE;
Expand Down
23 changes: 12 additions & 11 deletions drivers/input/tablet/wacom_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,27 +103,26 @@ static void wacom_sys_irq(struct urb *urb)
static int wacom_open(struct input_dev *dev)
{
struct wacom *wacom = input_get_drvdata(dev);
int retval = 0;

mutex_lock(&wacom->lock);

wacom->irq->dev = wacom->usbdev;

if (usb_autopm_get_interface(wacom->intf) < 0) {
mutex_unlock(&wacom->lock);
if (usb_autopm_get_interface(wacom->intf) < 0)
return -EIO;
}

mutex_lock(&wacom->lock);

if (usb_submit_urb(wacom->irq, GFP_KERNEL)) {
usb_autopm_put_interface(wacom->intf);
mutex_unlock(&wacom->lock);
return -EIO;
retval = -EIO;
goto out;
}

wacom->open = true;
wacom->intf->needs_remote_wakeup = 1;

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

static void wacom_close(struct input_dev *dev)
Expand All @@ -135,6 +134,8 @@ static void wacom_close(struct input_dev *dev)
wacom->open = false;
wacom->intf->needs_remote_wakeup = 0;
mutex_unlock(&wacom->lock);

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 afe1474

Please sign in to comment.