diff options
Diffstat (limited to 'drivers/iio/accel/kxsd9.c')
-rw-r--r-- | drivers/iio/accel/kxsd9.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/iio/accel/kxsd9.c b/drivers/iio/accel/kxsd9.c index d72118d1189c..98ba761cbb9c 100644 --- a/drivers/iio/accel/kxsd9.c +++ b/drivers/iio/accel/kxsd9.c | |||
@@ -112,9 +112,10 @@ static int kxsd9_read(struct iio_dev *indio_dev, u8 address) | |||
112 | mutex_lock(&st->buf_lock); | 112 | mutex_lock(&st->buf_lock); |
113 | st->tx[0] = KXSD9_READ(address); | 113 | st->tx[0] = KXSD9_READ(address); |
114 | ret = spi_sync_transfer(st->us, xfers, ARRAY_SIZE(xfers)); | 114 | ret = spi_sync_transfer(st->us, xfers, ARRAY_SIZE(xfers)); |
115 | if (ret) | 115 | if (!ret) |
116 | return ret; | 116 | ret = (((u16)(st->rx[0])) << 8) | (st->rx[1] & 0xF0); |
117 | return (((u16)(st->rx[0])) << 8) | (st->rx[1] & 0xF0); | 117 | mutex_unlock(&st->buf_lock); |
118 | return ret; | ||
118 | } | 119 | } |
119 | 120 | ||
120 | static IIO_CONST_ATTR(accel_scale_available, | 121 | static IIO_CONST_ATTR(accel_scale_available, |