staging: iio: impedance-analyzer: ad5933: use devm_mutex_init()
Subsystems (4)
PATCH 1/1 staging: iio: impedance-analyzer: ad5933: use devm_mutex_init()
Replace mutex_init() with devm_mutex_init() in ad5933_probe() and check its return value. The driver already uses devm_* helpers for its other resources and has no remove() callback, so this ensures the mutex is destroyed automatically on teardown when mutex debugging is enabled.
No functional change intended. Compile-tested only.
Signed-off-by Nithishvelan M <[email protected]>
--- drivers/staging/iio/impedance-analyzer/ad5933.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/staging/iio/impedance-analyzer/ad5933.c +3 -1
@@ -672,7 +672,9 @@ static int ad5933_probe(struct i2c_client *client)i2c_set_clientdata (client, indio_dev); st->client = client; -mutex_init (&st->lock); + ret =devm_mutex_init (&client->dev, &st->lock); +if (ret) +return ret; ret =devm_regulator_get_enable_read_voltage (&client->dev,"vdd" );if (ret <0 )
Signature · 1 line
2.53.0
Quoted 7 lines · Nithishvelan M
Replace
mutex_init()withdevm_mutex_init()inad5933_probe()and check its return value. The driver already uses devm_* helpers for its other resources and has noremove()callback, so this ensures the mutex is destroyed automatically on teardown when mutex debugging is enabled.No functional change intended. Compile-tested only.
Reviewed-by Andy Shevchenko <[email protected]>
Signature · 2 lines
With Best Regards, Andy Shevchenko