diff options
| -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) | |||
| 263 | return -EINVAL; | 263 | return -EINVAL; |
| 264 | } | 264 | } |
| 265 | 265 | ||
| 266 | if (test_bit(ABS_MT_SLOT, dev->absbit)) { | 266 | if (test_bit(EV_ABS, dev->evbit)) { |
| 267 | nslot = input_abs_get_max(dev, ABS_MT_SLOT) + 1; | 267 | input_alloc_absinfo(dev); |
| 268 | error = input_mt_init_slots(dev, nslot, 0); | 268 | if (!dev->absinfo) { |
| 269 | if (error) | 269 | error = -EINVAL; |
| 270 | goto fail1; | 270 | goto fail1; |
| 271 | } else if (test_bit(ABS_MT_POSITION_X, dev->absbit)) { | 271 | } |
| 272 | input_set_events_per_packet(dev, 60); | 272 | |
| 273 | if (test_bit(ABS_MT_SLOT, dev->absbit)) { | ||
| 274 | nslot = input_abs_get_max(dev, ABS_MT_SLOT) + 1; | ||
| 275 | error = input_mt_init_slots(dev, nslot, 0); | ||
| 276 | if (error) | ||
| 277 | goto fail1; | ||
| 278 | } else if (test_bit(ABS_MT_POSITION_X, dev->absbit)) { | ||
| 279 | input_set_events_per_packet(dev, 60); | ||
| 280 | } | ||
| 273 | } | 281 | } |
| 274 | 282 | ||
| 275 | if (test_bit(EV_FF, dev->evbit) && !udev->ff_effects_max) { | 283 | if (test_bit(EV_FF, dev->evbit) && !udev->ff_effects_max) { |
