iio: accel: adxl380: 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:19 +05:30 committed by Jonathan Cameron
parent c27837e49f
commit 1ed49c5e6b

View File

@ -1967,7 +1967,9 @@ int adxl380_probe(struct device *dev, struct regmap *regmap,
st->chip_info = chip_info;
st->odr = ADXL380_ODR_DSM;
mutex_init(&st->lock);
ret = devm_mutex_init(dev, &st->lock);
if (ret)
return ret;
indio_dev->channels = adxl380_channels;
indio_dev->num_channels = ARRAY_SIZE(adxl380_channels);