Skip to content

Commit

Permalink
Input: automatically set EV_ABS bit in input_set_abs_params
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
dtor committed Oct 8, 2014
1 parent b3f9db4 commit 2c9a9cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/input/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 2c9a9cf

Please sign in to comment.