Commit 0ff8c78d authored by Hartmut Knaack's avatar Hartmut Knaack Committed by Jonathan Cameron

iio:light:cm3323: replace unneeded variable

In cm3323_read_raw() i is used as return variable for the integration time
index. The also existing return variable ret however is unused in this
case, although appropriate. Replace i with ret and drop it.
Signed-off-by: default avatarHartmut Knaack <knaack.h@gmx.de>
Reviewed-by: default avatarDaniel Baluta <daniel.baluta@intel.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent e5c97027
...@@ -155,7 +155,7 @@ static int cm3323_read_raw(struct iio_dev *indio_dev, ...@@ -155,7 +155,7 @@ static int cm3323_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan, int *val, struct iio_chan_spec const *chan, int *val,
int *val2, long mask) int *val2, long mask)
{ {
int i, ret; int ret;
struct cm3323_data *data = iio_priv(indio_dev); struct cm3323_data *data = iio_priv(indio_dev);
switch (mask) { switch (mask) {
...@@ -172,14 +172,14 @@ static int cm3323_read_raw(struct iio_dev *indio_dev, ...@@ -172,14 +172,14 @@ static int cm3323_read_raw(struct iio_dev *indio_dev,
return IIO_VAL_INT; return IIO_VAL_INT;
case IIO_CHAN_INFO_INT_TIME: case IIO_CHAN_INFO_INT_TIME:
mutex_lock(&data->mutex); mutex_lock(&data->mutex);
i = cm3323_get_it_bits(data); ret = cm3323_get_it_bits(data);
if (i < 0) { if (ret < 0) {
mutex_unlock(&data->mutex); mutex_unlock(&data->mutex);
return i; return ret;
} }
*val = cm3323_int_time[i].val; *val = cm3323_int_time[ret].val;
*val2 = cm3323_int_time[i].val2; *val2 = cm3323_int_time[ret].val2;
mutex_unlock(&data->mutex); mutex_unlock(&data->mutex);
return IIO_VAL_INT_PLUS_MICRO; return IIO_VAL_INT_PLUS_MICRO;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment