From: Sanjay Chitroda Date: Fri, 17 Apr 2026 12:49:22 +0000 (+0530) Subject: iio: accel: adxl367: Use devm-managed mutex initialization X-Git-Tag: v7.2-rc1~67^2~5^2~227 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=f710a0fa462ce5fc356ab4a77787b49fc1f47f7b;p=thirdparty%2Flinux.git 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 Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/accel/adxl367.c b/drivers/iio/accel/adxl367.c index 0c04b2bb7efbf..63a0b182824f6 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);