mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] staging: iio: impedance-analyzer: ad5933: use devm_mutex_init()
@ 2026-10-27 16:08 Nithishvelan M
  2026-10-27 16:33 ` Andy Shevchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Nithishvelan M @ 2026-10-27 16:08 UTC (permalink / raw)
  To: Jonathan Cameron, Greg Kroah-Hartman
  Cc: Nuno Sa, Michael Hennerich, David Lechner, Andy Shevchenko,
	linux-iio, linux-staging, linux-kernel, Nithishvelan M

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 <mnithishvelan@gmail.com>
---
 drivers/staging/iio/impedance-analyzer/ad5933.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c
index c05a5f4b4..51d73c5ab 100644
--- a/drivers/staging/iio/impedance-analyzer/ad5933.c
+++ b/drivers/staging/iio/impedance-analyzer/ad5933.c
@@ -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)
-- 
2.53.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: iio: impedance-analyzer: ad5933: use devm_mutex_init()
  2026-10-27 16:08 [PATCH] staging: iio: impedance-analyzer: ad5933: use devm_mutex_init() Nithishvelan M
@ 2026-10-27 16:33 ` Andy Shevchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2026-10-27 16:33 UTC (permalink / raw)
  To: Nithishvelan M
  Cc: Jonathan Cameron, Greg Kroah-Hartman, Nuno Sa, Michael Hennerich,
	David Lechner, Andy Shevchenko, linux-iio, linux-staging,
	linux-kernel

On Tue, Oct 27, 2026 at 04:08:29PM +0000, Nithishvelan M wrote:
> 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.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-27 16:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-27 16:08 [PATCH] staging: iio: impedance-analyzer: ad5933: use devm_mutex_init() Nithishvelan M
2026-10-27 16:33 ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®