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>
This commit is contained in:
Sanjay Chitroda 2026-04-17 18:19:22 +05:30 committed by Jonathan Cameron
parent 70cc2c65c2
commit f710a0fa46

View File

@ -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);