Re: [PATCH] iio: proximity: as3935: move storm out of range check

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

 



On 27/04/17 06:30, Matt Ranostay wrote:
> Move out of storm check to apply to IIO_CHAN_INFO_RAW so the reported
> results are constant between the former and the IIO_CHAN_INFO_PROCESSED
> 
> Signed-off-by: Matt Ranostay <matt.ranostay@xxxxxxxxxxxx>
Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to play with it.

Thanks,

Jonathan
> ---
>  drivers/iio/proximity/as3935.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/proximity/as3935.c b/drivers/iio/proximity/as3935.c
> index ddf9bee89f77..aa0d0be1a608 100644
> --- a/drivers/iio/proximity/as3935.c
> +++ b/drivers/iio/proximity/as3935.c
> @@ -176,13 +176,13 @@ static int as3935_read_raw(struct iio_dev *indio_dev,
>  		if (ret)
>  			return ret;
>  
> -		if (m == IIO_CHAN_INFO_RAW)
> -			return IIO_VAL_INT;
> -
>  		/* storm out of range */
>  		if (*val == AS3935_DATA_MASK)
>  			return -EINVAL;
>  
> +		if (m == IIO_CHAN_INFO_RAW)
> +			return IIO_VAL_INT;
> +
>  		if (m == IIO_CHAN_INFO_PROCESSED)
>  			*val *= 1000;
>  		break;
> 

--
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