mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH RESEND] staging: iio: frequency: ad9832: use devm_mutex_init()
@ 2026-10-31  7:58 Nithishvelan M
  2026-10-31  8:51 ` Andy Shevchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Nithishvelan M @ 2026-10-31  7:58 UTC (permalink / raw)
  To: Jonathan Cameron, Greg Kroah-Hartman, Nuno Sá, Michael Hennerich
  Cc: David Lechner, Andy Shevchenko, linux-iio, linux-staging,
	linux-kernel, linux, Nithishvelan M

Replace mutex_init() with devm_mutex_init() in ad9832_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>
---
Resending because the first mail carried the patch as an attachment
instead of inline. No changes to the patch itself.

 drivers/staging/iio/frequency/ad9832.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/iio/frequency/ad9832.c b/drivers/staging/iio/frequency/ad9832.c
index 35f823f24f..a90ee89803 100644
--- a/drivers/staging/iio/frequency/ad9832.c
+++ b/drivers/staging/iio/frequency/ad9832.c
@@ -325,7 +325,9 @@ static int ad9832_probe(struct spi_device *spi)
 		return PTR_ERR(st->mclk);
 
 	st->spi = spi;
-	mutex_init(&st->lock);
+	ret = devm_mutex_init(&spi->dev, &st->lock);
+	if (ret)
+		return ret;
 
 	indio_dev->name = spi_get_device_id(spi)->name;
 	indio_dev->info = &ad9832_info;
-- 
2.56.0


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

* Re: [PATCH RESEND] staging: iio: frequency: ad9832: use devm_mutex_init()
  2026-10-31  7:58 [PATCH RESEND] staging: iio: frequency: ad9832: use devm_mutex_init() Nithishvelan M
@ 2026-10-31  8:51 ` Andy Shevchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2026-10-31  8:51 UTC (permalink / raw)
  To: Nithishvelan M
  Cc: Jonathan Cameron, Greg Kroah-Hartman, Nuno Sá,
	Michael Hennerich, David Lechner, Andy Shevchenko, linux-iio,
	linux-staging, linux-kernel, linux

On Sat, Oct 31, 2026 at 01:28:14PM +0530, Nithishvelan M wrote:
> Replace mutex_init() with devm_mutex_init() in ad9832_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>
> ---
> Resending because the first mail carried the patch as an attachment
> instead of inline. No changes to the patch itself.

Same comment as per that variant.

-- 
With Best Regards,
Andy Shevchenko



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

end of thread, other threads:[~2026-10-31  8:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-31  7:58 [PATCH RESEND] staging: iio: frequency: ad9832: use devm_mutex_init() Nithishvelan M
2026-10-31  8:51 ` 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®