]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iio: light: veml6070: fix veml6070_read() return value
authorAldo Conte <aldocontelk@gmail.com>
Wed, 25 Mar 2026 11:32:16 +0000 (12:32 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 26 Mar 2026 08:22:33 +0000 (08:22 +0000)
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>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/veml6070.c

index 6d4483c85f30cfe7bf8834ee8d4604ffa2af4b25..74d7246e5225e912e12c6528ab60196fae667558 100644 (file)
@@ -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[] = {