summaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2016-01-17 19:52:54 +0100
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2016-03-02 18:32:07 +0100
commit8631580f4fde9584ef39480eb0f2219708e5aeba (patch)
treec218be2577df873768bc1d00009abde0933e6460 /drivers/input
parentInput: rotary_encoder - convert to use gpiod API (diff)
downloadlinux-8631580f4fde9584ef39480eb0f2219708e5aeba.tar.xz
linux-8631580f4fde9584ef39480eb0f2219708e5aeba.zip
Input: rotary_encoder - use input_set_capability()
Instead of manipulating capability bits directly let's use appropriate helpers. Also there is no need to explicitly set EV_ABS when calling input_set_abs_params(). Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/misc/rotary_encoder.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/input/misc/rotary_encoder.c b/drivers/input/misc/rotary_encoder.c
index 471175e5306b..70fdcce84866 100644
--- a/drivers/input/misc/rotary_encoder.c
+++ b/drivers/input/misc/rotary_encoder.c
@@ -317,14 +317,10 @@ static int rotary_encoder_probe(struct platform_device *pdev)
input->id.bustype = BUS_HOST;
input->dev.parent = dev;
- if (pdata->relative_axis) {
- input->evbit[0] = BIT_MASK(EV_REL);
- input->relbit[0] = BIT_MASK(pdata->axis);
- } else {
- input->evbit[0] = BIT_MASK(EV_ABS);
- input_set_abs_params(encoder->input,
- pdata->axis, 0, pdata->steps, 0, 1);
- }
+ if (pdata->relative_axis)
+ input_set_capability(input, EV_REL, pdata->axis);
+ else
+ input_set_abs_params(input, pdata->axis, 0, pdata->steps, 0, 1);
switch (pdata->steps_per_period) {
case 4: