Commit d532e5b2 authored by Matt Ranostay's avatar Matt Ranostay Committed by Jonathan Cameron

iio: proximity: as3935: move storm out of range check

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: default avatarMatt Ranostay <matt.ranostay@konsulko.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent c894acc7
...@@ -176,13 +176,13 @@ static int as3935_read_raw(struct iio_dev *indio_dev, ...@@ -176,13 +176,13 @@ static int as3935_read_raw(struct iio_dev *indio_dev,
if (ret) if (ret)
return ret; return ret;
if (m == IIO_CHAN_INFO_RAW)
return IIO_VAL_INT;
/* storm out of range */ /* storm out of range */
if (*val == AS3935_DATA_MASK) if (*val == AS3935_DATA_MASK)
return -EINVAL; return -EINVAL;
if (m == IIO_CHAN_INFO_RAW)
return IIO_VAL_INT;
if (m == IIO_CHAN_INFO_PROCESSED) if (m == IIO_CHAN_INFO_PROCESSED)
*val *= 1000; *val *= 1000;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment