diff options
author | Brian Masney <masneyb@onstation.org> | 2016-09-25 07:41:06 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2016-09-27 21:08:47 +0100 |
commit | 528021fcd21fdffad83563710f1186d9b3d21718 (patch) | |
tree | d32f685089abf261c8017292478c681c379c1146 | |
parent | 7fd1accc9fc46c27687f2ea767d84c146790ef1c (diff) |
staging: iio: isl29018: made error handling consistent
Changed the processing of IIO_CHAN_INFO_INT_TIME in isl29018_write_raw()
to unlock the mutex and return at the end of the function if invalid
input is passed in. This makes the error handling code consistent with
the processing of IIO_CHAN_INFO_CALIBSCALE and IIO_CHAN_INFO_SCALE
within the same function.
Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r-- | drivers/staging/iio/light/isl29018.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/staging/iio/light/isl29018.c b/drivers/staging/iio/light/isl29018.c index 2a055d6c32ba..f03122c66045 100644 --- a/drivers/staging/iio/light/isl29018.c +++ b/drivers/staging/iio/light/isl29018.c @@ -356,13 +356,8 @@ static int isl29018_write_raw(struct iio_dev *indio_dev, } break; case IIO_CHAN_INFO_INT_TIME: - if (chan->type == IIO_LIGHT) { - if (val) { - mutex_unlock(&chip->lock); - return -EINVAL; - } + if (chan->type == IIO_LIGHT && !val) ret = isl29018_set_integration_time(chip, val2); - } break; case IIO_CHAN_INFO_SCALE: if (chan->type == IIO_LIGHT) |