Linux IIO development
 help / color / mirror / Atom feed
* [PATCH v2] iio: light: veml6070: fix veml6070_read() return value
@ 2026-03-26 16:38 Aldo Conte
  2026-03-26 20:29 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Aldo Conte @ 2026-03-26 16:38 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: linux-iio, linux-kernel, David Lechner, Nuno Sá,
	Andy Shevchenko, Javier Carrasco

veml6070_read() computes the sensor value in ret but
returns 0 instead of the actual result. This causes
veml6070_read_raw() to always report 0.

Return the computed value instead of 0.

Running make W=1 returns no errors. I was unable
to test the patch because I do not have the hardware.
Found by code inspection.

Fixes: fc38525135dd ("iio: light: veml6070: use guard to handle mutex")
Signed-off-by: Aldo Conte <aldocontelk@gmail.com>

---

v2:
- Fix correct commit in Fixes tag
---
 drivers/iio/light/veml6070.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/iio/light/veml6070.c b/drivers/iio/light/veml6070.c
index 6d4483c85f30..74d7246e5225 100644
--- a/drivers/iio/light/veml6070.c
+++ b/drivers/iio/light/veml6070.c
@@ -134,9 +134,7 @@ static int veml6070_read(struct veml6070_data *data)
 	if (ret < 0)
 		return ret;
 
-	ret = (msb << 8) | lsb;
-
-	return 0;
+	return (msb << 8) | lsb;
 }
 
 static const struct iio_chan_spec veml6070_channels[] = {
-- 
2.53.0


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

* Re: [PATCH v2] iio: light: veml6070: fix veml6070_read() return value
  2026-03-26 16:38 [PATCH v2] iio: light: veml6070: fix veml6070_read() return value Aldo Conte
@ 2026-03-26 20:29 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2026-03-26 20:29 UTC (permalink / raw)
  To: Aldo Conte
  Cc: linux-iio, linux-kernel, David Lechner, Nuno Sá,
	Andy Shevchenko, Javier Carrasco

On Thu, 26 Mar 2026 17:38:08 +0100
Aldo Conte <aldocontelk@gmail.com> wrote:

> veml6070_read() computes the sensor value in ret but
> returns 0 instead of the actual result. This causes
> veml6070_read_raw() to always report 0.
> 
> Return the computed value instead of 0.
> 
> Running make W=1 returns no errors. I was unable
> to test the patch because I do not have the hardware.
> Found by code inspection.
> 
> Fixes: fc38525135dd ("iio: light: veml6070: use guard to handle mutex")
> Signed-off-by: Aldo Conte <aldocontelk@gmail.com>
> 
Thanks for resend but as I replied (late) to your question its
already queued with the tag fixed:
https://web.git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/commit/?h=fixes-togreg

> ---
> 
> v2:
> - Fix correct commit in Fixes tag
> ---
>  drivers/iio/light/veml6070.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/light/veml6070.c b/drivers/iio/light/veml6070.c
> index 6d4483c85f30..74d7246e5225 100644
> --- a/drivers/iio/light/veml6070.c
> +++ b/drivers/iio/light/veml6070.c
> @@ -134,9 +134,7 @@ static int veml6070_read(struct veml6070_data *data)
>  	if (ret < 0)
>  		return ret;
>  
> -	ret = (msb << 8) | lsb;
> -
> -	return 0;
> +	return (msb << 8) | lsb;
>  }
>  
>  static const struct iio_chan_spec veml6070_channels[] = {


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

end of thread, other threads:[~2026-03-26 20:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-26 16:38 [PATCH v2] iio: light: veml6070: fix veml6070_read() return value Aldo Conte
2026-03-26 20:29 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox