On 25/09/16 12:41, Brian Masney wrote:
> 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 <[email protected]>
Nice little cleanup.
Applied to the togreg branch of iio.git. Initially pushed out
as testing for the autobuilders to play with it.
Thanks,
Jonathan
> ---
> drivers/staging/iio/light/isl29018.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/staging/iio/light/isl29018.c
> b/drivers/staging/iio/light/isl29018.c
> index ad282f1..0a35588 100644
> --- a/drivers/staging/iio/light/isl29018.c
> +++ b/drivers/staging/iio/light/isl29018.c
> @@ -364,13 +364,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)
>
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel