Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Aldo Conte and committed by
Jonathan Cameron
d0b224cf 2452969c

+1 -3
+1 -3
drivers/iio/light/veml6070.c
··· 134 134 if (ret < 0) 135 135 return ret; 136 136 137 - ret = (msb << 8) | lsb; 138 - 139 - return 0; 137 + return (msb << 8) | lsb; 140 138 } 141 139 142 140 static const struct iio_chan_spec veml6070_channels[] = {