linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: raydium_i2c_ts - fix error codes in raydium_i2c_boot_trigger()
@ 2020-03-03 10:13 Dan Carpenter
  2020-03-06 19:51 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2020-03-03 10:13 UTC (permalink / raw)
  To: Jeffrey Lin, Dmitry Torokhov, Gustavo A. R. Silva
  Cc: Alexios Zavras, Allison Randal, Rob Herring, linux-input,
	kernel-janitors

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 propogated back to user space.

Fixes: 48a2b783483b ("Input: add Raydium I2C touchscreen driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/input/touchscreen/raydium_i2c_ts.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/raydium_i2c_ts.c b/drivers/input/touchscreen/raydium_i2c_ts.c
index 6ed9f22e6401..fe245439adee 100644
--- a/drivers/input/touchscreen/raydium_i2c_ts.c
+++ b/drivers/input/touchscreen/raydium_i2c_ts.c
@@ -432,7 +432,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 },
@@ -457,10 +457,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 },
@@ -483,7 +483,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)
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Input: raydium_i2c_ts - fix error codes in raydium_i2c_boot_trigger()
  2020-03-03 10:13 [PATCH] Input: raydium_i2c_ts - fix error codes in raydium_i2c_boot_trigger() Dan Carpenter
@ 2020-03-06 19:51 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2020-03-06 19:51 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Jeffrey Lin, Gustavo A. R. Silva, Alexios Zavras, Allison Randal,
	Rob Herring, linux-input, kernel-janitors

On Tue, Mar 03, 2020 at 01:13:06PM +0300, Dan Carpenter wrote:
> 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 propogated back to user space.
> 
> Fixes: 48a2b783483b ("Input: add Raydium I2C touchscreen driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied, thank you.

> ---
>  drivers/input/touchscreen/raydium_i2c_ts.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/raydium_i2c_ts.c b/drivers/input/touchscreen/raydium_i2c_ts.c
> index 6ed9f22e6401..fe245439adee 100644
> --- a/drivers/input/touchscreen/raydium_i2c_ts.c
> +++ b/drivers/input/touchscreen/raydium_i2c_ts.c
> @@ -432,7 +432,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 },
> @@ -457,10 +457,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 },
> @@ -483,7 +483,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)
> -- 
> 2.11.0
> 

-- 
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-06 19:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-03 10:13 [PATCH] Input: raydium_i2c_ts - fix error codes in raydium_i2c_boot_trigger() Dan Carpenter
2020-03-06 19:51 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).