Re: [PATCH v2 1/3] iio: chemical: atlas-ph-sensor: switch to iio_device_*_direct_mode helpers

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

 



On 19/08/16 21:36, Matt Ranostay wrote:
> Signed-off-by: Matt Ranostay <mranostay@xxxxxxxxx>
Applied to the togreg branch of iio.git - initially pushed out
as testing for the autobuilders to play with it.

Thanks,

Jonathan
> ---
>  drivers/iio/chemical/atlas-ph-sensor.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/iio/chemical/atlas-ph-sensor.c b/drivers/iio/chemical/atlas-ph-sensor.c
> index ae038a59d256..696875413d10 100644
> --- a/drivers/iio/chemical/atlas-ph-sensor.c
> +++ b/drivers/iio/chemical/atlas-ph-sensor.c
> @@ -402,15 +402,13 @@ static int atlas_read_raw(struct iio_dev *indio_dev,
>  		case IIO_PH:
>  		case IIO_CONCENTRATION:
>  		case IIO_ELECTRICALCONDUCTIVITY:
> -			mutex_lock(&indio_dev->mlock);
> +			ret = iio_device_claim_direct_mode(indio_dev);
> +			if (ret)
> +				return ret;
>  
> -			if (iio_buffer_enabled(indio_dev))
> -				ret = -EBUSY;
> -			else
> -				ret = atlas_read_measurement(data,
> -							chan->address, &reg);
> +			ret = atlas_read_measurement(data, chan->address, &reg);
>  
> -			mutex_unlock(&indio_dev->mlock);
> +			iio_device_release_direct_mode(indio_dev);
>  			break;
>  		default:
>  			ret = -EINVAL;
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux