Re: [PATCH v3 4/5] staging: iio: isl29018: change isl29018_read_raw() to only have one exit point

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 27/09/16 01:20, Brian Masney wrote:
> When the chip is in a suspended state, isl29018_read_raw() will return
> -EBUSY. Change the function so that it only has a single exit point.
> 
> Signed-off-by: Brian Masney <masneyb@xxxxxxxxxxxxx>
Applied.

Thanks,

Jonathan
> ---
>  drivers/staging/iio/light/isl29018.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/iio/light/isl29018.c b/drivers/staging/iio/light/isl29018.c
> index 990c6e5..3a4d79d 100644
> --- a/drivers/staging/iio/light/isl29018.c
> +++ b/drivers/staging/iio/light/isl29018.c
> @@ -390,8 +390,8 @@ static int isl29018_read_raw(struct iio_dev *indio_dev,
>  
>  	mutex_lock(&chip->lock);
>  	if (chip->suspended) {
> -		mutex_unlock(&chip->lock);
> -		return -EBUSY;
> +		ret = -EBUSY;
> +		goto read_done;
>  	}
>  	switch (mask) {
>  	case IIO_CHAN_INFO_RAW:
> @@ -438,6 +438,8 @@ static int isl29018_read_raw(struct iio_dev *indio_dev,
>  	default:
>  		break;
>  	}
> +
> +read_done:
>  	mutex_unlock(&chip->lock);
>  	return ret;
>  }
> 

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux