From: Sanjay Chitroda Date: Fri, 17 Apr 2026 12:49:23 +0000 (+0530) Subject: iio: accel: adxl372: Use devm-managed mutex initialization X-Git-Tag: v7.2-rc1~67^2~5^2~226 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=24ab1d9a2fc4c1e4f2546bebcee2b420295120a0;p=thirdparty%2Fkernel%2Flinux.git iio: accel: adxl372: 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/adxl372.c b/drivers/iio/accel/adxl372.c index 545a21e5a3084..1a6ba94f54f4b 100644 --- a/drivers/iio/accel/adxl372.c +++ b/drivers/iio/accel/adxl372.c @@ -1299,7 +1299,9 @@ int adxl372_probe(struct device *dev, struct regmap *regmap, st->irq = irq; st->chip_info = chip_info; - mutex_init(&st->threshold_m); + ret = devm_mutex_init(dev, &st->threshold_m); + if (ret < 0) + return ret; indio_dev->channels = adxl372_channels; indio_dev->num_channels = ARRAY_SIZE(adxl372_channels);