Re: [PATCH 1/2] iio: tmp006: Check channel info on write

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

 



On 21/06/15 22:50, Peter Meerwald wrote:
> only SAMP_FREQ is writable
> 
> Signed-off-by: Peter Meerwald <pmeerw@xxxxxxxxxx>
Applied to the fixes-for-4.2 branch of iio.git

Thanks,

Jonathan
> ---
>  drivers/iio/temperature/tmp006.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/iio/temperature/tmp006.c b/drivers/iio/temperature/tmp006.c
> index 84a0789..7a80509 100644
> --- a/drivers/iio/temperature/tmp006.c
> +++ b/drivers/iio/temperature/tmp006.c
> @@ -132,6 +132,9 @@ static int tmp006_write_raw(struct iio_dev *indio_dev,
>  	struct tmp006_data *data = iio_priv(indio_dev);
>  	int i;
>  
> +	if (mask != IIO_CHAN_INFO_SAMP_FREQ)
> +		return -EINVAL;
> +
>  	for (i = 0; i < ARRAY_SIZE(tmp006_freqs); i++)
>  		if ((val == tmp006_freqs[i][0]) &&
>  		    (val2 == tmp006_freqs[i][1])) {
> 

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