Input: ili210x - fix ili251x_read_touch_data() return value

[ Upstream commit 9f0fad0382 ]

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: ef536abd3a ("Input: ili210x - define and use chip operations structure")
Signed-off-by: John Keeping <jkeeping@inmusicbrands.com>
Link: https://lore.kernel.org/r/20240523085624.2295988-1-jkeeping@inmusicbrands.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
John Keeping 2024-05-23 09:56:24 +01:00 committed by Greg Kroah-Hartman
parent d9933caf86
commit f1d05111b3

View File

@ -261,8 +261,8 @@ static int ili251x_read_touch_data(struct i2c_client *client, u8 *data)
if (!error && data[0] == 2) { if (!error && data[0] == 2) {
error = i2c_master_recv(client, data + ILI251X_DATA_SIZE1, error = i2c_master_recv(client, data + ILI251X_DATA_SIZE1,
ILI251X_DATA_SIZE2); ILI251X_DATA_SIZE2);
if (error >= 0 && error != ILI251X_DATA_SIZE2) if (error >= 0)
error = -EIO; error = error == ILI251X_DATA_SIZE2 ? 0 : -EIO;
} }
return error; return error;