]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Input: ili210x - handle errors from input_mt_init_slots()
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 4 Nov 2019 18:39:41 +0000 (10:39 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 12 Nov 2019 00:11:53 +0000 (16:11 -0800)
input_mt_init_slots() may fail and we need to handle such failures.

Tested-by: Adam Ford <aford173@gmail.com> #imx6q-logicpd
Tested-by: Sven Van Asbroeck <TheSven73@gmail.com> # ILI2118A variant
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/ili210x.c

index 6985ca8b656558d1ad97e5b2ffd2aa95c3a5cbdf..7dee37901b7bbafe23f8782f52db6adabb06bf1b 100644 (file)
@@ -371,7 +371,12 @@ static int ili210x_i2c_probe(struct i2c_client *client,
        input_set_abs_params(input, ABS_MT_POSITION_X, 0, 0xffff, 0, 0);
        input_set_abs_params(input, ABS_MT_POSITION_Y, 0, 0xffff, 0, 0);
        touchscreen_parse_properties(input, true, &priv->prop);
-       input_mt_init_slots(input, priv->max_touches, INPUT_MT_DIRECT);
+
+       error = input_mt_init_slots(input, priv->max_touches, INPUT_MT_DIRECT);
+       if (error) {
+               dev_err(dev, "Unable to set up slots, err: %d\n", error);
+               return error;
+       }
 
        error = devm_request_threaded_irq(dev, client->irq, NULL, ili210x_irq,
                                          IRQF_ONESHOT, client->name, priv);