Input: raydium_i2c_ts - fix error codes in raydium_i2c_boot_trigger()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 6 Mar 2020 19:50:51 +0000 (11:50 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Apr 2020 14:34:33 +0000 (16:34 +0200)
[ Upstream commit 32cf3a610c35cb21e3157f4bbf29d89960e30a36 ]

These functions are supposed to return negative error codes but instead
it returns true on failure and false on success.  The error codes are
eventually propagated back to user space.

Fixes: 48a2b783483b ("Input: add Raydium I2C touchscreen driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20200303101306.4potflz7na2nn3od@kili.mountain
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/input/touchscreen/raydium_i2c_ts.c

index 172f66e9da2d10a2f73430132ce230c2399f9c1f..7da44956555e5b80b03379f707045e2956c3be2b 100644 (file)
@@ -441,7 +441,7 @@ static int raydium_i2c_write_object(struct i2c_client *client,
        return 0;
 }
 
-static bool raydium_i2c_boot_trigger(struct i2c_client *client)
+static int raydium_i2c_boot_trigger(struct i2c_client *client)
 {
        static const u8 cmd[7][6] = {
                { 0x08, 0x0C, 0x09, 0x00, 0x50, 0xD7 },
@@ -466,10 +466,10 @@ static bool raydium_i2c_boot_trigger(struct i2c_client *client)
                }
        }
 
-       return false;
+       return 0;
 }
 
-static bool raydium_i2c_fw_trigger(struct i2c_client *client)
+static int raydium_i2c_fw_trigger(struct i2c_client *client)
 {
        static const u8 cmd[5][11] = {
                { 0, 0x09, 0x71, 0x0C, 0x09, 0x00, 0x50, 0xD7, 0, 0, 0 },
@@ -492,7 +492,7 @@ static bool raydium_i2c_fw_trigger(struct i2c_client *client)
                }
        }
 
-       return false;
+       return 0;
 }
 
 static int raydium_i2c_check_path(struct i2c_client *client)