diff options
| author | Sanjay Chitroda <sanjayembeddedse@gmail.com> | 2026-04-17 18:19:17 +0530 |
|---|---|---|
| committer | Jonathan Cameron <jic23@kernel.org> | 2026-04-27 09:58:19 +0100 |
| commit | d2ed8a2f630abe69d87eeffb2781df9237d7c1dd (patch) | |
| tree | 0d9bafa0ec35062e4a2dfb098dcb271dfe75ba85 /drivers | |
| parent | 2e8a75ac286a51eccd51b68715960563a2ee9c4d (diff) | |
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>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/iio/accel/adxl313_core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/iio/accel/adxl313_core.c b/drivers/iio/accel/adxl313_core.c index bcc11dabdf22..1fc96b7b0f1f 100644 --- a/drivers/iio/accel/adxl313_core.c +++ b/drivers/iio/accel/adxl313_core.c @@ -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; |
