summaryrefslogtreecommitdiff
path: root/drivers/iio/accel/mma7455_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iio/accel/mma7455_core.c')
-rw-r--r--drivers/iio/accel/mma7455_core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/iio/accel/mma7455_core.c b/drivers/iio/accel/mma7455_core.c
index 777c6c384b09..e6739ba74edf 100644
--- a/drivers/iio/accel/mma7455_core.c
+++ b/drivers/iio/accel/mma7455_core.c
@@ -134,7 +134,8 @@ static int mma7455_read_raw(struct iio_dev *indio_dev,
if (ret)
return ret;
- *val = sign_extend32(le16_to_cpu(data), 9);
+ *val = sign_extend32(le16_to_cpu(data),
+ chan->scan_type.realbits - 1);
return IIO_VAL_INT;