All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Carlier <devnexen@gmail.com>
To: Jonathan Cameron <jic23@kernel.org>, linux-iio@vger.kernel.org
Cc: "David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	"Kim Seer Paller" <kimseer.paller@analog.com>,
	"Cosmin Tanislav" <cosmin.tanislav@analog.com>,
	linux-kernel@vger.kernel.org,
	"David Carlier" <devnexen@gmail.com>
Subject: [PATCH 3/7] iio: dac: ad5758: Use devm_mutex_init()
Date: Fri, 10 Apr 2026 20:37:33 +0100	[thread overview]
Message-ID: <20260410193737.35905-4-devnexen@gmail.com> (raw)
In-Reply-To: <20260410193737.35905-1-devnexen@gmail.com>

Use devm_mutex_init() which is helpful with CONFIG_DEBUG_MUTEXES.

Signed-off-by: David Carlier <devnexen@gmail.com>
---
 drivers/iio/dac/ad5758.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/dac/ad5758.c b/drivers/iio/dac/ad5758.c
index 4ed4fda76ea9..8e6fb46cce4d 100644
--- a/drivers/iio/dac/ad5758.c
+++ b/drivers/iio/dac/ad5758.c
@@ -851,7 +851,9 @@ static int ad5758_probe(struct spi_device *spi)
 
 	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 = &ad5758_info;
-- 
2.53.0


  parent reply	other threads:[~2026-04-10 19:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-10 19:37 [PATCH 0/7] iio: dac: Convert several drivers to devm_mutex_init() David Carlier
2026-04-10 19:37 ` [PATCH 1/7] iio: dac: ad3552r: Use devm_mutex_init() David Carlier
2026-04-10 19:37 ` [PATCH 2/7] iio: dac: ad7303: " David Carlier
2026-04-10 19:37 ` David Carlier [this message]
2026-04-10 19:37 ` [PATCH 4/7] iio: dac: ad5755: " David Carlier
2026-04-10 19:37 ` [PATCH 5/7] iio: dac: ad5686: " David Carlier
2026-04-10 19:37 ` [PATCH 6/7] iio: dac: ltc2664: " David Carlier
2026-04-10 19:37 ` [PATCH 7/7] iio: addac: ad74115: " David Carlier
2026-04-10 20:03 ` [PATCH 0/7] iio: dac: Convert several drivers to devm_mutex_init() David Lechner
2026-04-20 13:21   ` Jonathan Cameron
2026-04-20 13:39     ` David CARLIER

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=20260410193737.35905-4-devnexen@gmail.com \
    --to=devnexen@gmail.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=cosmin.tanislav@analog.com \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=kimseer.paller@analog.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.