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

iio: light: tcs3414: Fix bug preventing to set integration time

the millisecond values in tcs3414_times should be checked against
val2, not val, which is always zero.

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Reported-by: Stephan Kleisinger <stephan.kleisinger@gmail.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

authored by

Peter Meerwald and committed by
Jonathan Cameron
40f34b0c c13c9da6

+1 -1
+1 -1
drivers/iio/light/tcs3414.c
··· 185 185 if (val != 0) 186 186 return -EINVAL; 187 187 for (i = 0; i < ARRAY_SIZE(tcs3414_times); i++) { 188 - if (val == tcs3414_times[i] * 1000) { 188 + if (val2 == tcs3414_times[i] * 1000) { 189 189 data->timing &= ~TCS3414_INTEG_MASK; 190 190 data->timing |= i; 191 191 return i2c_smbus_write_byte_data(