From: Jonathan Cameron <jic23@kernel.org>
To: Nithishvelan M <mnithishvelan@gmail.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Nuno Sá" <nuno.sa@analog.com>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"David Lechner" <dlechner@baylibre.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-iio@vger.kernel.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org, linux@analog.com
Subject: Re: [PATCH v2] staging: iio: frequency: ad9832: use devm_mutex_init()
Date: Sat, 31 Oct 2026 23:14:13 +0000 [thread overview]
Message-ID: <20261031231413.19937479@jic23-hlaptop> (raw)
In-Reply-To: <20261031091236.40401-1-mnithishvelan@gmail.com>
On Sat, 31 Oct 2026 14:42:36 +0530
Nithishvelan M <mnithishvelan@gmail.com> 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>
Applied.
Thanks,
Jonathan
> ---
> Changes in v2:
> - Add blank line after "st->spi = spi;" (Andy)
>
> drivers/staging/iio/frequency/ad9832.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/iio/frequency/ad9832.c b/drivers/staging/iio/frequency/ad9832.c
> index 35f823f24f..e3b4e19a8d 100644
> --- a/drivers/staging/iio/frequency/ad9832.c
> +++ b/drivers/staging/iio/frequency/ad9832.c
> @@ -325,7 +325,10 @@ 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;
prev parent reply other threads:[~2026-10-31 23:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-31 9:12 Nithishvelan M
2026-10-31 23:14 ` Jonathan Cameron [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261031231413.19937479@jic23-hlaptop \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=linux@analog.com \
--cc=mnithishvelan@gmail.com \
--cc=nuno.sa@analog.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®