Input: ads7846 - use input_set_capability()
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 10 Sep 2021 04:50:38 +0000 (21:50 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 16 Oct 2021 05:09:48 +0000 (22:09 -0700)
Instead of manipulating capability bits directly use
input_set_capability(). Also stop setting EV_ABS explicitly as
input_set_abs_params() does it for us.

Link: https://lore.kernel.org/r/20210910045039.4020199-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/ads7846.c

index a018481..0f97335 100644 (file)
@@ -1307,8 +1307,7 @@ static int ads7846_probe(struct spi_device *spi)
        input_dev->id.bustype = BUS_SPI;
        input_dev->id.product = pdata->model;
 
-       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
-       input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
+       input_set_capability(input_dev, EV_KEY, BTN_TOUCH);
        input_set_abs_params(input_dev, ABS_X,
                        pdata->x_min ? : 0,
                        pdata->x_max ? : MAX_12BIT,