Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Aishwarya Pant <aishpant@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

authored by

Aishwarya Pant and committed by
Jonathan Cameron
099c4cef 2e2c8d22

+1 -5
+1 -5
drivers/staging/iio/accel/adis16201.c
··· 223 223 default: 224 224 return -EINVAL; 225 225 } 226 - mutex_lock(&indio_dev->mlock); 227 226 addr = adis16201_addresses[chan->scan_index]; 228 227 ret = adis_read_reg_16(st, addr, &val16); 229 - if (ret) { 230 - mutex_unlock(&indio_dev->mlock); 228 + if (ret) 231 229 return ret; 232 - } 233 230 val16 &= (1 << bits) - 1; 234 231 val16 = (s16)(val16 << (16 - bits)) >> (16 - bits); 235 232 *val = val16; 236 - mutex_unlock(&indio_dev->mlock); 237 233 return IIO_VAL_INT; 238 234 } 239 235 return -EINVAL;