summaryrefslogtreecommitdiffstats
path: root/drivers/iio/gyro
diff options
context:
space:
mode:
authorNuno Sá <nuno.sa@analog.com>2021-05-20 13:59:08 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-06-03 19:24:13 +0200
commit0990c6e428c81faefc3e6c53291f8ad8080577fd (patch)
tree7ca0e5d984b5f94d9dffe04c3bf76e99ca14cd0a /drivers/iio/gyro
parentstaging: iio: cdc: ad7746: use dt for capacitive channel setup. (diff)
downloadlinux-0990c6e428c81faefc3e6c53291f8ad8080577fd.tar.xz
linux-0990c6e428c81faefc3e6c53291f8ad8080577fd.zip
iio: adis16260: make use of adis lock helpers
Use the adis lib lock helpers to lock the device. This makes things consistent with other users of the library. Signed-off-by: Nuno Sá <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20210520115909.466275-2-nuno.sa@analog.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/gyro')
-rw-r--r--drivers/iio/gyro/adis16260.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/gyro/adis16260.c b/drivers/iio/gyro/adis16260.c
index e7c9a3e31c45..56f930bbd341 100644
--- a/drivers/iio/gyro/adis16260.c
+++ b/drivers/iio/gyro/adis16260.c
@@ -293,7 +293,7 @@ static int adis16260_write_raw(struct iio_dev *indio_dev,
addr = adis16260_addresses[chan->scan_index][1];
return adis_write_reg_16(adis, addr, val);
case IIO_CHAN_INFO_SAMP_FREQ:
- mutex_lock(&adis->state_lock);
+ adis_dev_lock(adis);
if (spi_get_device_id(adis->spi)->driver_data)
t = 256 / val;
else
@@ -310,7 +310,7 @@ static int adis16260_write_raw(struct iio_dev *indio_dev,
adis->spi->max_speed_hz = ADIS16260_SPI_FAST;
ret = __adis_write_reg_8(adis, ADIS16260_SMPL_PRD, t);
- mutex_unlock(&adis->state_lock);
+ adis_dev_unlock(adis);
return ret;
}
return -EINVAL;