iio: proximity: rfd77402: 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.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Shrikant Raskar <raskar.shree97@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
Shrikant Raskar 2026-01-28 23:21:51 +05:30 committed by Jonathan Cameron
parent 51eedb3a32
commit dff4bdff07

View file

@ -287,7 +287,10 @@ static int rfd77402_probe(struct i2c_client *client)
data = iio_priv(indio_dev);
data->client = client;
mutex_init(&data->lock);
ret = devm_mutex_init(&client->dev, &data->lock);
if (ret)
return ret;
indio_dev->info = &rfd77402_info;
indio_dev->channels = rfd77402_channels;