mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
iio: light: rohm-bu27034: Fix error return
When BU27034 fails to read gain value at integration-time setting, it
returns 0. This leaves caller unaware of the fact that setting the
integration time failed.
Fix this by returning the relevant error instead of zero.
Fixes: 439c2cef81 ("iio: bu27034: simplify using guard(mutex)")
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
This commit is contained in:
parent
b0e951ffc5
commit
4e5b0b7c5d
|
|
@ -415,7 +415,7 @@ static int bu27034_try_set_int_time(struct bu27034_data *data, int time_us)
|
|||
for (i = 0; i < numg; i++) {
|
||||
ret = bu27034_get_gain(data, gains[i].chan, &gains[i].old_gain);
|
||||
if (ret)
|
||||
return 0;
|
||||
return ret;
|
||||
|
||||
ret = iio_gts_find_new_gain_by_old_gain_time(&data->gts,
|
||||
gains[i].old_gain,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user