Skip to contentSkip to conversation

iio: light: veml6070: fix veml6070_read() return value

PATCH In review Aldo Conte 2 participants 2 messages Mar 26 IIO

lore
Share & tools
lore

Aldo Conte

author
#0 lore raw

PATCH v2 1/1 iio: light: veml6070: fix veml6070_read() return value

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

---

v2:
- Fix correct commit in Fixes tag

---
 drivers/iio/light/veml6070.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iio/light/veml6070.c +1 -3
index 6d4483c85f30..74d7246e5225 100644
@@ -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[] = {
Signature · 1 line
2.53.0
maintainer
#1 lore raw
Quoted 4 lines · On Thu, 26 Mar 2026 17:38:08 +0100 Aldo Conte <[email protected]> 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.

Quoted 9 lines

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

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

Quoted 23 lines

---

v2:
- Fix correct commit in Fixes tag

---
 drivers/iio/light/veml6070.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iio/light/veml6070.c +1 -3
index 6d4483c85f30..74d7246e5225 100644
@@ -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[] = {