mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 10:09:10 +02:00
iio: accel: adxl313_core: 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> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
parent
2e8a75ac28
commit
d2ed8a2f63
|
|
@ -1240,7 +1240,9 @@ int adxl313_core_probe(struct device *dev,
|
|||
data->regmap = regmap;
|
||||
data->chip_info = chip_info;
|
||||
|
||||
mutex_init(&data->lock);
|
||||
ret = devm_mutex_init(dev, &data->lock);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
indio_dev->name = chip_info->name;
|
||||
indio_dev->info = &adxl313_info;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user