Commit 66893ea3 authored by Gargi Sharma's avatar Gargi Sharma Committed by Jonathan Cameron

staging: adis16203: Remove locking on raw reads of IIO_CHAN_INFO_CALIBBIAS

adis16203_read_raw does not need lock for IIO_CHAN_INFO_CALIBBIAS
since adis_read_reg_16 is already atomic and nothing else needs to be
protected.
Signed-off-by: default avatarGargi Sharma <gs051095@gmail.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 745c6dad
...@@ -203,17 +203,14 @@ static int adis16203_read_raw(struct iio_dev *indio_dev, ...@@ -203,17 +203,14 @@ static int adis16203_read_raw(struct iio_dev *indio_dev,
return IIO_VAL_INT; return IIO_VAL_INT;
case IIO_CHAN_INFO_CALIBBIAS: case IIO_CHAN_INFO_CALIBBIAS:
bits = 14; bits = 14;
mutex_lock(&indio_dev->mlock);
addr = adis16203_addresses[chan->scan_index]; addr = adis16203_addresses[chan->scan_index];
ret = adis_read_reg_16(st, addr, &val16); ret = adis_read_reg_16(st, addr, &val16);
if (ret) { if (ret) {
mutex_unlock(&indio_dev->mlock);
return ret; return ret;
} }
val16 &= (1 << bits) - 1; val16 &= (1 << bits) - 1;
val16 = (s16)(val16 << (16 - bits)) >> (16 - bits); val16 = (s16)(val16 << (16 - bits)) >> (16 - bits);
*val = val16; *val = val16;
mutex_unlock(&indio_dev->mlock);
return IIO_VAL_INT; return IIO_VAL_INT;
default: default:
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment