Commit 099c4cef authored by Aishwarya Pant's avatar Aishwarya Pant Committed by Jonathan Cameron

staging: iio: accel: adis16201: remove iio_dev mlock

In the driver adis16201 read raw does not require an iio_dev->mlock for
reads. It can run concurrently as adis_read_reg_16() is protected by a
transaction lock.
Signed-off-by: default avatarAishwarya Pant <aishpant@gmail.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 2e2c8d22
......@@ -223,17 +223,13 @@ static int adis16201_read_raw(struct iio_dev *indio_dev,
default:
return -EINVAL;
}
mutex_lock(&indio_dev->mlock);
addr = adis16201_addresses[chan->scan_index];
ret = adis_read_reg_16(st, addr, &val16);
if (ret) {
mutex_unlock(&indio_dev->mlock);
if (ret)
return ret;
}
val16 &= (1 << bits) - 1;
val16 = (s16)(val16 << (16 - bits)) >> (16 - bits);
*val = val16;
mutex_unlock(&indio_dev->mlock);
return IIO_VAL_INT;
}
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