Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: David Lechner <dlechner@baylibre.com>
Cc: linux-iio@vger.kernel.org,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	Angelo Dureghello <adureghello@baylibre.com>,
	Alexandru Ardelean <aardelean@baylibre.com>,
	Beniamin Bia <beniamin.bia@analog.com>,
	Stefan Popa <stefan.popa@analog.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 05/11] iio: adc: ad7606: use devm_mutex_init()
Date: Sat, 15 Mar 2025 18:52:51 +0000	[thread overview]
Message-ID: <20250315185251.63fe37e8@jic23-huawei> (raw)
In-Reply-To: <20250312-iio-adc-ad7606-improvements-v1-5-d1ec04847aea@baylibre.com>

On Wed, 12 Mar 2025 20:15:43 -0500
David Lechner <dlechner@baylibre.com> wrote:

> Use devm_mutex_init() in ad7606_probe(). Mutexes should be cleaned up
> on driver removal.
> 
> Also add missing include while we are touching this.
> 
> Signed-off-by: David Lechner <dlechner@baylibre.com>

Just for the record (in case anyone other than us two is watching ;)
I'm not keen to have large numbers of patches doing this at this
point as the benefit in debug ability this brings is pretty tiny.

I'm absolutely fine with it in a series making other cleanup
type changes to a driver though - so fine here!

Note I will probably pick up the fixes soon after rc1 given
some look pretty important. That means stuff like this may have
to wait a while for the fixes to circulate around to the char-misc-next branch.

Jonathan

> ---
>  drivers/iio/adc/ad7606.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c
> index 440e1e5a9b18570dc6441bff91afbc51d20cbc47..f190269ac8ddd859e94eb24c26f5f010d0951646 100644
> --- a/drivers/iio/adc/ad7606.c
> +++ b/drivers/iio/adc/ad7606.c
> @@ -13,6 +13,7 @@
>  #include <linux/interrupt.h>
>  #include <linux/kernel.h>
>  #include <linux/module.h>
> +#include <linux/mutex.h>
>  #include <linux/property.h>
>  #include <linux/pwm.h>
>  #include <linux/regulator/consumer.h>
> @@ -1332,8 +1333,11 @@ int ad7606_probe(struct device *dev, int irq, void __iomem *base_address,
>  	st = iio_priv(indio_dev);
>  	dev_set_drvdata(dev, indio_dev);
>  
> +	ret = devm_mutex_init(dev, &st->lock);
> +	if (ret)
> +		return ret;
> +
>  	st->dev = dev;
> -	mutex_init(&st->lock);
>  	st->bops = bops;
>  	st->base_address = base_address;
>  	st->oversampling = 1;
> 


  reply	other threads:[~2025-03-15 18:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-13  1:15 [PATCH 00/11] iio: adc: ad7606: improvements and ad7606c parallel interface support David Lechner
2025-03-13  1:15 ` [PATCH 01/11] iio: adc: ad7606_spi: check error in ad7606B_sw_mode_config() David Lechner
2025-03-15 18:48   ` Jonathan Cameron
2025-03-13  1:15 ` [PATCH 02/11] iio: adc: ad7606: check for NULL before calling sw_mode_config() David Lechner
2025-03-13  1:15 ` [PATCH 03/11] iio: adc: ad7606: fix scales_available attributes David Lechner
2025-03-13  1:15 ` [PATCH 04/11] iio: adc: ad7606: add missing max sample rates David Lechner
2025-03-13  1:15 ` [PATCH 05/11] iio: adc: ad7606: use devm_mutex_init() David Lechner
2025-03-15 18:52   ` Jonathan Cameron [this message]
2025-03-13  1:15 ` [PATCH 06/11] iio: adc: ad7606: fix kernel-doc comments David Lechner
2025-03-15 18:55   ` Jonathan Cameron
2025-03-13  1:15 ` [PATCH 07/11] iio: adc: ad7606: use kernel identifier name style David Lechner
2025-03-13  1:15 ` [PATCH 08/11] iio: adc: ad7606: don't use address field David Lechner
2025-03-13  1:15 ` [PATCH 09/11] iio: adc: ad7606: drop ch param from ad7606_scale_setup_cb_t David Lechner
2025-03-13  1:15 ` [PATCH 10/11] iio: adc: ad7606: dynamically allocate channel info David Lechner
2025-03-15 19:02   ` Jonathan Cameron
2025-03-13  1:15 ` [PATCH 11/11] iio: adc: ad7606_par: add ad7606c chips David Lechner
2025-03-13 21:11 ` [PATCH 00/11] iio: adc: ad7606: improvements and ad7606c parallel interface support Nuno Sá

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=20250315185251.63fe37e8@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=aardelean@baylibre.com \
    --cc=adureghello@baylibre.com \
    --cc=beniamin.bia@analog.com \
    --cc=dlechner@baylibre.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stefan.popa@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