diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2017-03-09 19:03:22 +0100 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2017-03-09 19:03:22 +0100 |
commit | 7b179e251ba089898b4e8e6d065be8ae2c0a4a3e (patch) | |
tree | d8c5fe6a2d5330da4d7e53e8b85c1540e1fa404a /drivers/input/misc | |
parent | Input: soc_button_array - use NULL for GPIO connection ID (diff) | |
parent | Input: sparse-keymap - use a managed allocation for keymap copy (diff) | |
download | linux-7b179e251ba089898b4e8e6d065be8ae2c0a4a3e.tar.xz linux-7b179e251ba089898b4e8e6d065be8ae2c0a4a3e.zip |
Merge branch 'ib/4.10-sparse-keymap-managed' into next
This brings in version of sparse keymap code that uses managed memory.
Diffstat (limited to 'drivers/input/misc')
-rw-r--r-- | drivers/input/misc/uinput.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c index 92595b98e7ed..022be0e22eba 100644 --- a/drivers/input/misc/uinput.c +++ b/drivers/input/misc/uinput.c @@ -263,13 +263,21 @@ static int uinput_create_device(struct uinput_device *udev) return -EINVAL; } - if (test_bit(ABS_MT_SLOT, dev->absbit)) { - nslot = input_abs_get_max(dev, ABS_MT_SLOT) + 1; - error = input_mt_init_slots(dev, nslot, 0); - if (error) + if (test_bit(EV_ABS, dev->evbit)) { + input_alloc_absinfo(dev); + if (!dev->absinfo) { + error = -EINVAL; goto fail1; - } else if (test_bit(ABS_MT_POSITION_X, dev->absbit)) { - input_set_events_per_packet(dev, 60); + } + + if (test_bit(ABS_MT_SLOT, dev->absbit)) { + nslot = input_abs_get_max(dev, ABS_MT_SLOT) + 1; + error = input_mt_init_slots(dev, nslot, 0); + if (error) + goto fail1; + } else if (test_bit(ABS_MT_POSITION_X, dev->absbit)) { + input_set_events_per_packet(dev, 60); + } } if (test_bit(EV_FF, dev->evbit) && !udev->ff_effects_max) { |