mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
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:
parent
f710a0fa46
commit
24ab1d9a2f
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user