Skip to content

Commit

Permalink
Input: ili210x - fix ili251x_read_touch_data() return value
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
johnkeeping authored and dtor committed Jun 7, 2024
1 parent 955af63 commit 9f0fad0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/input/touchscreen/ili210x.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ static int ili251x_read_touch_data(struct i2c_client *client, u8 *data)
if (!error && data[0] == 2) {
error = i2c_master_recv(client, data + ILI251X_DATA_SIZE1,
ILI251X_DATA_SIZE2);
if (error >= 0 && error != ILI251X_DATA_SIZE2)
error = -EIO;
if (error >= 0)
error = error == ILI251X_DATA_SIZE2 ? 0 : -EIO;
}

return error;
Expand Down

0 comments on commit 9f0fad0

Please sign in to comment.