summaryrefslogtreecommitdiff
path: root/drivers/iio/accel/stk8312.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iio/accel/stk8312.c')
-rw-r--r--drivers/iio/accel/stk8312.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/accel/stk8312.c b/drivers/iio/accel/stk8312.c
index 43c621d0f11e..de0cdf8c1f94 100644
--- a/drivers/iio/accel/stk8312.c
+++ b/drivers/iio/accel/stk8312.c
@@ -355,7 +355,7 @@ static int stk8312_read_raw(struct iio_dev *indio_dev,
mutex_unlock(&data->lock);
return ret;
}
- *val = sign_extend32(ret, 7);
+ *val = sign_extend32(ret, chan->scan_type.realbits - 1);
ret = stk8312_set_mode(data,
data->mode & (~STK8312_MODE_ACTIVE));
mutex_unlock(&data->lock);