mirror of
https://github.com/torvalds/linux.git
synced 2026-07-30 11:11:26 +02:00
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 <sanjayembeddedse@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
parent
70cc2c65c2
commit
f710a0fa46
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user