mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 05:44:45 +01:00
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:
parent
51eedb3a32
commit
dff4bdff07
1 changed files with 4 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue