alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: sigmadsp: Fix missleading return value
@ 2016-02-10 14:51 pascal.huerst
  2016-02-10 14:55 ` Lars-Peter Clausen
  0 siblings, 1 reply; 4+ messages in thread
From: pascal.huerst @ 2016-02-10 14:51 UTC (permalink / raw)
  To: lars; +Cc: alsa-devel, Pascal Huerst

From: Pascal Huerst <pascal.huerst@gmail.com>

Forwarding the return value of i2c_master_send, leads to errors
later on, since i2c_master_send returns the number of bytes
transmittet. Check for ret < 0 instead and return 0 otherwise.

Signed-off-by: Pascal Huerst <pascal.huerst@gmail.com>
---
 sound/soc/codecs/sigmadsp-i2c.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/sigmadsp-i2c.c b/sound/soc/codecs/sigmadsp-i2c.c
index 21ca3a5..d374c18 100644
--- a/sound/soc/codecs/sigmadsp-i2c.c
+++ b/sound/soc/codecs/sigmadsp-i2c.c
@@ -31,7 +31,10 @@ static int sigmadsp_write_i2c(void *control_data,
 
 	kfree(buf);
 
-	return ret;
+	if (ret < 0)
+		return ret;
+
+	return 0;
 }
 
 static int sigmadsp_read_i2c(void *control_data,
-- 
2.4.3

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

* Re: [PATCH] ASoC: sigmadsp: Fix missleading return value
  2016-02-10 14:51 pascal.huerst
@ 2016-02-10 14:55 ` Lars-Peter Clausen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars-Peter Clausen @ 2016-02-10 14:55 UTC (permalink / raw)
  To: pascal.huerst; +Cc: alsa-devel

On 02/10/2016 03:51 PM, pascal.huerst@gmail.com wrote:
> From: Pascal Huerst <pascal.huerst@gmail.com>
> 
> Forwarding the return value of i2c_master_send, leads to errors
> later on, since i2c_master_send returns the number of bytes
> transmittet. Check for ret < 0 instead and return 0 otherwise.
> 
> Signed-off-by: Pascal Huerst <pascal.huerst@gmail.com>

Thanks.

Acked-by: Lars-Peter Clausen <lars@metafoo.de>

Please resend to the ASoC maintainers otherwise it wont get picked up.

> ---
>  sound/soc/codecs/sigmadsp-i2c.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/codecs/sigmadsp-i2c.c b/sound/soc/codecs/sigmadsp-i2c.c
> index 21ca3a5..d374c18 100644
> --- a/sound/soc/codecs/sigmadsp-i2c.c
> +++ b/sound/soc/codecs/sigmadsp-i2c.c
> @@ -31,7 +31,10 @@ static int sigmadsp_write_i2c(void *control_data,
>  
>  	kfree(buf);
>  
> -	return ret;
> +	if (ret < 0)
> +		return ret;
> +
> +	return 0;
>  }
>  
>  static int sigmadsp_read_i2c(void *control_data,
> 

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

* [PATCH] ASoC: sigmadsp: Fix missleading return value
@ 2016-02-10 14:59 pascal.huerst
  2016-02-10 15:02 ` Lars-Peter Clausen
  0 siblings, 1 reply; 4+ messages in thread
From: pascal.huerst @ 2016-02-10 14:59 UTC (permalink / raw)
  To: lars; +Cc: alsa-devel, broonie, Pascal Huerst, lgirdwood

From: Pascal Huerst <pascal.huerst@gmail.com>

Forwarding the return value of i2c_master_send, leads to errors
later on, since i2c_master_send returns the number of bytes
transmittet. Check for ret < 0 instead and return 0 otherwise.

Signed-off-by: Pascal Huerst <pascal.huerst@gmail.com>
---
 sound/soc/codecs/sigmadsp-i2c.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/sigmadsp-i2c.c b/sound/soc/codecs/sigmadsp-i2c.c
index 21ca3a5..d374c18 100644
--- a/sound/soc/codecs/sigmadsp-i2c.c
+++ b/sound/soc/codecs/sigmadsp-i2c.c
@@ -31,7 +31,10 @@ static int sigmadsp_write_i2c(void *control_data,
 
 	kfree(buf);
 
-	return ret;
+	if (ret < 0)
+		return ret;
+
+	return 0;
 }
 
 static int sigmadsp_read_i2c(void *control_data,
-- 
2.4.3

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

* Re: [PATCH] ASoC: sigmadsp: Fix missleading return value
  2016-02-10 14:59 [PATCH] ASoC: sigmadsp: Fix missleading return value pascal.huerst
@ 2016-02-10 15:02 ` Lars-Peter Clausen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars-Peter Clausen @ 2016-02-10 15:02 UTC (permalink / raw)
  To: pascal.huerst; +Cc: alsa-devel, broonie, lgirdwood

On 02/10/2016 03:59 PM, pascal.huerst@gmail.com wrote:
> From: Pascal Huerst <pascal.huerst@gmail.com>
> 
> Forwarding the return value of i2c_master_send, leads to errors
> later on, since i2c_master_send returns the number of bytes
> transmittet. Check for ret < 0 instead and return 0 otherwise.
> 
> Signed-off-by: Pascal Huerst <pascal.huerst@gmail.com>

Acked-by: Lars-Peter Clausen <lars@metafoo.de>

> ---
>  sound/soc/codecs/sigmadsp-i2c.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/codecs/sigmadsp-i2c.c b/sound/soc/codecs/sigmadsp-i2c.c
> index 21ca3a5..d374c18 100644
> --- a/sound/soc/codecs/sigmadsp-i2c.c
> +++ b/sound/soc/codecs/sigmadsp-i2c.c
> @@ -31,7 +31,10 @@ static int sigmadsp_write_i2c(void *control_data,
>  
>  	kfree(buf);
>  
> -	return ret;
> +	if (ret < 0)
> +		return ret;
> +
> +	return 0;
>  }
>  
>  static int sigmadsp_read_i2c(void *control_data,
> 

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

end of thread, other threads:[~2016-02-10 15:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-10 14:59 [PATCH] ASoC: sigmadsp: Fix missleading return value pascal.huerst
2016-02-10 15:02 ` Lars-Peter Clausen
  -- strict thread matches above, loose matches on Subject: below --
2016-02-10 14:51 pascal.huerst
2016-02-10 14:55 ` Lars-Peter Clausen

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).