diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2014-08-07 02:36:12 -0400 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2014-08-07 02:36:12 -0400 |
| commit | 5e2aa2ed08e2e280121dc7cf5609c87d464f12ef (patch) | |
| tree | ca7d7b1480285e3b617fecc5b41f0ce150a82c32 /drivers/input/misc | |
| parent | f62d14a8072b9756db36ba394e2b267470a40240 (diff) | |
| parent | fc8104bc5a3f6f49d79f45f2706f79f77a9fb2ae (diff) | |
Merge branch 'next' into for-linus
Prepare first round of input updates for 3.17.
Diffstat (limited to 'drivers/input/misc')
| -rw-r--r-- | drivers/input/misc/keyspan_remote.c | 1 | ||||
| -rw-r--r-- | drivers/input/misc/soc_button_array.c | 3 | ||||
| -rw-r--r-- | drivers/input/misc/uinput.c | 47 |
3 files changed, 31 insertions, 20 deletions
diff --git a/drivers/input/misc/keyspan_remote.c b/drivers/input/misc/keyspan_remote.c index 01f3b5b300f3..a3fe4a990cc9 100644 --- a/drivers/input/misc/keyspan_remote.c +++ b/drivers/input/misc/keyspan_remote.c | |||
| @@ -392,7 +392,6 @@ static void keyspan_irq_recv(struct urb *urb) | |||
| 392 | 392 | ||
| 393 | default: | 393 | default: |
| 394 | goto resubmit; | 394 | goto resubmit; |
| 395 | break; | ||
| 396 | } | 395 | } |
| 397 | 396 | ||
| 398 | if (debug) | 397 | if (debug) |
diff --git a/drivers/input/misc/soc_button_array.c b/drivers/input/misc/soc_button_array.c index 5a6334be30b8..e34dfc29beb3 100644 --- a/drivers/input/misc/soc_button_array.c +++ b/drivers/input/misc/soc_button_array.c | |||
| @@ -83,6 +83,9 @@ soc_button_device_create(struct pnp_dev *pdev, | |||
| 83 | sizeof(*gpio_keys_pdata) + | 83 | sizeof(*gpio_keys_pdata) + |
| 84 | sizeof(*gpio_keys) * MAX_NBUTTONS, | 84 | sizeof(*gpio_keys) * MAX_NBUTTONS, |
| 85 | GFP_KERNEL); | 85 | GFP_KERNEL); |
| 86 | if (!gpio_keys_pdata) | ||
| 87 | return ERR_PTR(-ENOMEM); | ||
| 88 | |||
| 86 | gpio_keys = (void *)(gpio_keys_pdata + 1); | 89 | gpio_keys = (void *)(gpio_keys_pdata + 1); |
| 87 | 90 | ||
| 88 | for (info = button_info; info->name; info++) { | 91 | for (info = button_info; info->name; info++) { |
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c index 856936247500..421e29e4cd81 100644 --- a/drivers/input/misc/uinput.c +++ b/drivers/input/misc/uinput.c | |||
| @@ -311,7 +311,14 @@ static int uinput_open(struct inode *inode, struct file *file) | |||
| 311 | static int uinput_validate_absbits(struct input_dev *dev) | 311 | static int uinput_validate_absbits(struct input_dev *dev) |
| 312 | { | 312 | { |
| 313 | unsigned int cnt; | 313 | unsigned int cnt; |
| 314 | int retval = 0; | 314 | int nslot; |
| 315 | |||
| 316 | if (!test_bit(EV_ABS, dev->evbit)) | ||
| 317 | return 0; | ||
| 318 | |||
| 319 | /* | ||
| 320 | * Check if absmin/absmax/absfuzz/absflat are sane. | ||
| 321 | */ | ||
| 315 | 322 | ||
| 316 | for (cnt = 0; cnt < ABS_CNT; cnt++) { | 323 | for (cnt = 0; cnt < ABS_CNT; cnt++) { |
| 317 | int min, max; | 324 | int min, max; |
| @@ -327,8 +334,7 @@ static int uinput_validate_absbits(struct input_dev *dev) | |||
| 327 | UINPUT_NAME, cnt, | 334 | UINPUT_NAME, cnt, |
| 328 | input_abs_get_min(dev, cnt), | 335 | input_abs_get_min(dev, cnt), |
| 329 | input_abs_get_max(dev, cnt)); | 336 | input_abs_get_max(dev, cnt)); |
| 330 | retval = -EINVAL; | 337 | return -EINVAL; |
| 331 | break; | ||
| 332 | } | 338 | } |
| 333 | 339 | ||
| 334 | if (input_abs_get_flat(dev, cnt) > | 340 | if (input_abs_get_flat(dev, cnt) > |
| @@ -340,11 +346,18 @@ static int uinput_validate_absbits(struct input_dev *dev) | |||
| 340 | input_abs_get_flat(dev, cnt), | 346 | input_abs_get_flat(dev, cnt), |
| 341 | input_abs_get_min(dev, cnt), | 347 | input_abs_get_min(dev, cnt), |
| 342 | input_abs_get_max(dev, cnt)); | 348 | input_abs_get_max(dev, cnt)); |
| 343 | retval = -EINVAL; | 349 | return -EINVAL; |
| 344 | break; | ||
| 345 | } | 350 | } |
| 346 | } | 351 | } |
| 347 | return retval; | 352 | |
| 353 | if (test_bit(ABS_MT_SLOT, dev->absbit)) { | ||
| 354 | nslot = input_abs_get_max(dev, ABS_MT_SLOT) + 1; | ||
| 355 | input_mt_init_slots(dev, nslot, 0); | ||
| 356 | } else if (test_bit(ABS_MT_POSITION_X, dev->absbit)) { | ||
| 357 | input_set_events_per_packet(dev, 60); | ||
| 358 | } | ||
| 359 | |||
| 360 | return 0; | ||
| 348 | } | 361 | } |
| 349 | 362 | ||
| 350 | static int uinput_allocate_device(struct uinput_device *udev) | 363 | static int uinput_allocate_device(struct uinput_device *udev) |
| @@ -410,19 +423,9 @@ static int uinput_setup_device(struct uinput_device *udev, | |||
| 410 | input_abs_set_flat(dev, i, user_dev->absflat[i]); | 423 | input_abs_set_flat(dev, i, user_dev->absflat[i]); |
| 411 | } | 424 | } |
| 412 | 425 | ||
| 413 | /* check if absmin/absmax/absfuzz/absflat are filled as | 426 | retval = uinput_validate_absbits(dev); |
| 414 | * told in Documentation/input/input-programming.txt */ | 427 | if (retval < 0) |
| 415 | if (test_bit(EV_ABS, dev->evbit)) { | 428 | goto exit; |
| 416 | retval = uinput_validate_absbits(dev); | ||
| 417 | if (retval < 0) | ||
| 418 | goto exit; | ||
| 419 | if (test_bit(ABS_MT_SLOT, dev->absbit)) { | ||
| 420 | int nslot = input_abs_get_max(dev, ABS_MT_SLOT) + 1; | ||
| 421 | input_mt_init_slots(dev, nslot, 0); | ||
| 422 | } else if (test_bit(ABS_MT_POSITION_X, dev->absbit)) { | ||
| 423 | input_set_events_per_packet(dev, 60); | ||
| 424 | } | ||
| 425 | } | ||
| 426 | 429 | ||
| 427 | udev->state = UIST_SETUP_COMPLETE; | 430 | udev->state = UIST_SETUP_COMPLETE; |
| 428 | retval = count; | 431 | retval = count; |
| @@ -720,6 +723,12 @@ static long uinput_ioctl_handler(struct file *file, unsigned int cmd, | |||
| 720 | } | 723 | } |
| 721 | 724 | ||
| 722 | switch (cmd) { | 725 | switch (cmd) { |
| 726 | case UI_GET_VERSION: | ||
| 727 | if (put_user(UINPUT_VERSION, | ||
| 728 | (unsigned int __user *)p)) | ||
| 729 | retval = -EFAULT; | ||
| 730 | goto out; | ||
| 731 | |||
| 723 | case UI_DEV_CREATE: | 732 | case UI_DEV_CREATE: |
| 724 | retval = uinput_create_device(udev); | 733 | retval = uinput_create_device(udev); |
| 725 | goto out; | 734 | goto out; |
