mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 10:09:10 +02:00
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:
parent
c27837e49f
commit
1ed49c5e6b
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user