diff options
author | Hartmut Knaack <knaack.h@gmx.de> | 2015-06-17 18:32:03 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2015-06-21 09:27:38 -0400 |
commit | 0ff8c78df8d7c32394b887de4d935962a7f373ce (patch) | |
tree | 65a5c998e96ac148d78e3a72446e1f3d5586a687 | |
parent | e5c97027449f235415990310e47071ec371fd46c (diff) |
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: Hartmut Knaack <knaack.h@gmx.de>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r-- | drivers/iio/light/cm3323.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/iio/light/cm3323.c b/drivers/iio/light/cm3323.c index 9c9136309ffe..af1b1b025258 100644 --- a/drivers/iio/light/cm3323.c +++ b/drivers/iio/light/cm3323.c | |||
@@ -155,7 +155,7 @@ static int cm3323_read_raw(struct iio_dev *indio_dev, | |||
155 | struct iio_chan_spec const *chan, int *val, | 155 | struct iio_chan_spec const *chan, int *val, |
156 | int *val2, long mask) | 156 | int *val2, long mask) |
157 | { | 157 | { |
158 | int i, ret; | 158 | int ret; |
159 | struct cm3323_data *data = iio_priv(indio_dev); | 159 | struct cm3323_data *data = iio_priv(indio_dev); |
160 | 160 | ||
161 | switch (mask) { | 161 | switch (mask) { |
@@ -172,14 +172,14 @@ static int cm3323_read_raw(struct iio_dev *indio_dev, | |||
172 | return IIO_VAL_INT; | 172 | return IIO_VAL_INT; |
173 | case IIO_CHAN_INFO_INT_TIME: | 173 | case IIO_CHAN_INFO_INT_TIME: |
174 | mutex_lock(&data->mutex); | 174 | mutex_lock(&data->mutex); |
175 | i = cm3323_get_it_bits(data); | 175 | ret = cm3323_get_it_bits(data); |
176 | if (i < 0) { | 176 | if (ret < 0) { |
177 | mutex_unlock(&data->mutex); | 177 | mutex_unlock(&data->mutex); |
178 | return i; | 178 | return ret; |
179 | } | 179 | } |
180 | 180 | ||
181 | *val = cm3323_int_time[i].val; | 181 | *val = cm3323_int_time[ret].val; |
182 | *val2 = cm3323_int_time[i].val2; | 182 | *val2 = cm3323_int_time[ret].val2; |
183 | mutex_unlock(&data->mutex); | 183 | mutex_unlock(&data->mutex); |
184 | 184 | ||
185 | return IIO_VAL_INT_PLUS_MICRO; | 185 | return IIO_VAL_INT_PLUS_MICRO; |