mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
iio: magnetometer: yamaha-yas530: Use devm_mutex_init() for mutex initialization
Use devm_mutex_init() since it brings some benefits when CONFIG_DEBUG_MUTEXES is enabled. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
parent
10ecf78420
commit
6a0814f6f9
|
|
@ -1405,7 +1405,10 @@ static int yas5xx_probe(struct i2c_client *i2c)
|
|||
yas5xx = iio_priv(indio_dev);
|
||||
i2c_set_clientdata(i2c, indio_dev);
|
||||
yas5xx->dev = dev;
|
||||
mutex_init(&yas5xx->lock);
|
||||
|
||||
ret = devm_mutex_init(dev, &yas5xx->lock);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = iio_read_mount_matrix(dev, &yas5xx->orientation);
|
||||
if (ret)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user