Re: [PATCH] iio: chemical: atlas-ph-sensor: correct IIO_TEMP values to millicelsius

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

 



On Sun, 30 Dec 2018 19:07:01 -0800
Matt Ranostay <matt.ranostay@xxxxxxxxxxxx> wrote:

> IIO_TEMP scale value for temperature was incorrect and not in millicelsius
> as required by the ABI documentation.
> 
> Signed-off-by: Matt Ranostay <matt.ranostay@xxxxxxxxxxxx>
Ideally would have had a fixes tag.  Looks superficially like this
goes back a long way but always nice to confirm how far :)

Anyhow, given we are in the merge window, I'll pick this up once rc1
is out and mark it for stable etc.

Give me a poke if I seem to have lost it in a week or so.

Thanks,

Jonathan

> ---
>  drivers/iio/chemical/atlas-ph-sensor.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/chemical/atlas-ph-sensor.c b/drivers/iio/chemical/atlas-ph-sensor.c
> index a406ad31b096..3a20cb5d9bff 100644
> --- a/drivers/iio/chemical/atlas-ph-sensor.c
> +++ b/drivers/iio/chemical/atlas-ph-sensor.c
> @@ -444,9 +444,8 @@ static int atlas_read_raw(struct iio_dev *indio_dev,
>  	case IIO_CHAN_INFO_SCALE:
>  		switch (chan->type) {
>  		case IIO_TEMP:
> -			*val = 1; /* 0.01 */
> -			*val2 = 100;
> -			break;
> +			*val = 10;
> +			return IIO_VAL_INT;
>  		case IIO_PH:
>  			*val = 1; /* 0.001 */
>  			*val2 = 1000;
> @@ -477,7 +476,7 @@ static int atlas_write_raw(struct iio_dev *indio_dev,
>  			   int val, int val2, long mask)
>  {
>  	struct atlas_data *data = iio_priv(indio_dev);
> -	__be32 reg = cpu_to_be32(val);
> +	__be32 reg = cpu_to_be32(val / 10);
>  
>  	if (val2 != 0 || val < 0 || val > 20000)
>  		return -EINVAL;




[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