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@konsulko.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
                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;