Input: automatically set EV_ABS bit in input_set_abs_params
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 8 Oct 2014 16:28:32 +0000 (09:28 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 8 Oct 2014 18:06:12 +0000 (11:06 -0700)
Let's automatically set EV_ABS bit in device's event type list when calling
input_set_abs_params() so that drivers do not have to do it explicitly.

These calls are never in a hot paths so we won't lose much time by setting
the same bit several times.

Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/input.c

index 29ca0bb4f561e6af3960218d027bfd4ac6b300fa..d2e06cc7e179709f0e0943716e2b340115955814 100644 (file)
@@ -498,7 +498,8 @@ void input_set_abs_params(struct input_dev *dev, unsigned int axis,
        absinfo->fuzz = fuzz;
        absinfo->flat = flat;
 
-       dev->absbit[BIT_WORD(axis)] |= BIT_MASK(axis);
+       __set_bit(EV_ABS, dev->evbit);
+       __set_bit(axis, dev->absbit);
 }
 EXPORT_SYMBOL(input_set_abs_params);