]> Git Repo - J-linux.git/commitdiff
Input: ili210x - fix ili251x_read_touch_data() return value
authorJohn Keeping <[email protected]>
Thu, 23 May 2024 08:56:24 +0000 (09:56 +0100)
committerDmitry Torokhov <[email protected]>
Fri, 7 Jun 2024 23:35:36 +0000 (16:35 -0700)
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: ef536abd3afd1 ("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]>
drivers/input/touchscreen/ili210x.c

index 31ffdc2a93f35aaf72bb67a3931f5cc0441ab3f7..79bdb2b109496f7e4d8b3a482b35c1fbf9967b70 100644 (file)
@@ -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;
This page took 0.054373 seconds and 4 git commands to generate.