Skip to content

Commit 9f0fad0

Browse files
johnkeepingdtor
authored andcommitted
Input: ili210x - fix ili251x_read_touch_data() return value
The caller of this function treats all non-zero values as an error, so the return value of i2c_master_recv() cannot be returned directly. This fixes touch reporting when there are more than 6 active touches. Fixes: ef536ab ("Input: ili210x - define and use chip operations structure") Signed-off-by: John Keeping <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 955af63 commit 9f0fad0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/input/touchscreen/ili210x.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,8 @@ static int ili251x_read_touch_data(struct i2c_client *client, u8 *data)
261261
if (!error && data[0] == 2) {
262262
error = i2c_master_recv(client, data + ILI251X_DATA_SIZE1,
263263
ILI251X_DATA_SIZE2);
264-
if (error >= 0 && error != ILI251X_DATA_SIZE2)
265-
error = -EIO;
264+
if (error >= 0)
265+
error = error == ILI251X_DATA_SIZE2 ? 0 : -EIO;
266266
}
267267

268268
return error;

0 commit comments

Comments
 (0)