Skip to content

Commit 43f06a4

Browse files
committed
Input: ili210x - handle errors from input_mt_init_slots()
input_mt_init_slots() may fail and we need to handle such failures. Tested-by: Adam Ford <[email protected]> #imx6q-logicpd Tested-by: Sven Van Asbroeck <[email protected]> # ILI2118A variant Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 71f8e38 commit 43f06a4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/input/touchscreen/ili210x.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,12 @@ static int ili210x_i2c_probe(struct i2c_client *client,
371371
input_set_abs_params(input, ABS_MT_POSITION_X, 0, 0xffff, 0, 0);
372372
input_set_abs_params(input, ABS_MT_POSITION_Y, 0, 0xffff, 0, 0);
373373
touchscreen_parse_properties(input, true, &priv->prop);
374-
input_mt_init_slots(input, priv->max_touches, INPUT_MT_DIRECT);
374+
375+
error = input_mt_init_slots(input, priv->max_touches, INPUT_MT_DIRECT);
376+
if (error) {
377+
dev_err(dev, "Unable to set up slots, err: %d\n", error);
378+
return error;
379+
}
375380

376381
error = devm_request_threaded_irq(dev, client->irq, NULL, ili210x_irq,
377382
IRQF_ONESHOT, client->name, priv);

0 commit comments

Comments
 (0)