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 <sanjayembeddedse@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
Sanjay Chitroda 2026-04-17 18:19:23 +05:30 committed by Jonathan Cameron
parent f710a0fa46
commit 24ab1d9a2f

View File

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