summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSanjay Chitroda <sanjayembeddedse@gmail.com>2026-04-17 18:19:22 +0530
committerJonathan Cameron <jic23@kernel.org>2026-04-27 09:58:19 +0100
commitf710a0fa462ce5fc356ab4a77787b49fc1f47f7b (patch)
tree5cde9c3d42ec79dcb4499c2b03a43c023da4c845 /drivers
parent70cc2c65c23ba212c6de61a727131ebf94a66610 (diff)
downloadlinux-f710a0fa462ce5fc356ab4a77787b49fc1f47f7b.tar.gz
linux-f710a0fa462ce5fc356ab4a77787b49fc1f47f7b.zip
iio: accel: adxl367: Use devm-managed mutex initialization
Use devm_mutex_init() to tie the mutex lifetime to the device and improve debugging when CONFIG_DEBUG_MUTEXES is enabled. Signed-off-by: Sanjay Chitroda <sanjayembeddedse@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/iio/accel/adxl367.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/iio/accel/adxl367.c b/drivers/iio/accel/adxl367.c
index 0c04b2bb7efb..63a0b182824f 100644
--- a/drivers/iio/accel/adxl367.c
+++ b/drivers/iio/accel/adxl367.c
@@ -1445,7 +1445,9 @@ int adxl367_probe(struct device *dev, const struct adxl367_ops *ops,
st->context = context;
st->ops = ops;
- mutex_init(&st->lock);
+ ret = devm_mutex_init(dev, &st->lock);
+ if (ret)
+ return ret;
indio_dev->channels = adxl367_channels;
indio_dev->num_channels = ARRAY_SIZE(adxl367_channels);