Commit d0b224cf authored by Aldo Conte's avatar Aldo Conte Committed by Jonathan Cameron
Browse files

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: fc385251 ("iio: light: veml6070: use guard to handle mutex")
Signed-off-by: default avatarAldo Conte <aldocontelk@gmail.com>
Reviewed-by: default avatarNuno Sá <nuno.sa@analog.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 2452969c
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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[] = {