summaryrefslogtreecommitdiffstats
path: root/drivers/iio/inkern.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iio/inkern.c')
-rw-r--r--drivers/iio/inkern.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
index b0f4630a163f..7a13535dc3e9 100644
--- a/drivers/iio/inkern.c
+++ b/drivers/iio/inkern.c
@@ -601,8 +601,14 @@ static int iio_convert_raw_to_processed_unlocked(struct iio_channel *chan,
scale_type = iio_channel_read(chan, &scale_val, &scale_val2,
IIO_CHAN_INFO_SCALE);
- if (scale_type < 0)
- return scale_type;
+ if (scale_type < 0) {
+ /*
+ * Just pass raw values as processed if no scaling is
+ * available.
+ */
+ *processed = raw;
+ return 0;
+ }
switch (scale_type) {
case IIO_VAL_INT: