public inbox for linux-doc@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Angelo Dureghello <adureghello@baylibre.com>
Cc: "Nuno Sá" <nuno.sa@analog.com>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Olivier Moysan" <olivier.moysan@foss.st.com>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	linux-iio@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 5/5] iio: dac: ad3552r-hs: add support for internal ramp
Date: Sun, 6 Apr 2025 10:20:08 +0100	[thread overview]
Message-ID: <20250406102008.0ebcbf9e@jic23-huawei> (raw)
In-Reply-To: <20250331-wip-bl-ad3552r-fixes-v2-5-cdedb430497e@baylibre.com>

On Mon, 31 Mar 2025 21:02:48 +0200
Angelo Dureghello <adureghello@baylibre.com> wrote:

> From: Angelo Dureghello <adureghello@baylibre.com>
> 
> The ad3552r can be feeded from the HDL controller by an internally
> generated 16bit ramp, useful for debug pourposes. Add debugfs a file
> to enable or disable it.
> 
> Signed-off-by: Angelo Dureghello <adureghello@baylibre.com>

A couple of really minor things inline.

> ---
>  drivers/iio/dac/ad3552r-hs.c | 122 ++++++++++++++++++++++++++++++++++++++++---
>  1 file changed, 116 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/iio/dac/ad3552r-hs.c b/drivers/iio/dac/ad3552r-hs.c
> index 37397e188f225a8099745ec03f7c604da76960b1..d4f50b33565f99b90859e30571dc59038d01361c 100644
> --- a/drivers/iio/dac/ad3552r-hs.c
> +++ b/drivers/iio/dac/ad3552r-hs.c
> @@ -7,6 +7,7 @@
>   */
>  
>  #include <linux/bitfield.h>
> +#include <linux/debugfs.h>
>  #include <linux/delay.h>
>  #include <linux/gpio/consumer.h>
>  #include <linux/iio/backend.h>
> @@ -54,8 +55,12 @@ struct ad3552r_hs_state {
>  	struct ad3552r_hs_platform_data *data;
>  	/* INTERFACE_CONFIG_D register cache, in DDR we cannot read values. */
>  	u32 config_d;
> +	struct mutex lock;

Minor thing but all locks need comments.  What data is this lock protecting?

>  };
...

>  static int ad3552r_hs_probe(struct platform_device *pdev)
>  {
>  	struct ad3552r_hs_state *st;
> @@ -705,7 +806,16 @@ static int ad3552r_hs_probe(struct platform_device *pdev)
>  	if (ret)
>  		return ret;
>  
> -	return devm_iio_device_register(&pdev->dev, indio_dev);
> +	ret = devm_iio_device_register(&pdev->dev, indio_dev);
> +	if (ret)
> +		return ret;
> +
> +	mutex_init(&st->lock);
For new code, I'd prefer

	ret = devm_mutex_init(&st->lock);
	if (ret)
		return ret;

Brings only a small advantage, but give the complexity cost is also small
we might as well use it!

> +
> +	ad3552r_hs_debugfs_init(indio_dev);
> +
> +	return ret;
> +
>  }
>  
>  static const struct of_device_id ad3552r_hs_of_id[] = {
> 


      reply	other threads:[~2025-04-06  9:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-31 19:02 [PATCH v2 0/5] iio: ad3552r-hs: add support for internal ramp generator Angelo Dureghello
2025-03-31 19:02 ` [PATCH v2 1/5] iio: dac: adi-axi-dac: add cntrl chan check Angelo Dureghello
2025-03-31 19:02 ` [PATCH v2 2/5] docs: iio: add documentation for ad3552r driver Angelo Dureghello
2025-03-31 19:02 ` [PATCH v2 3/5] iio: backend: add support for data source get Angelo Dureghello
2025-04-06  9:15   ` Jonathan Cameron
2025-03-31 19:02 ` [PATCH v2 4/5] iio: dac: adi-axi-dac: add " Angelo Dureghello
2025-03-31 19:02 ` [PATCH v2 5/5] iio: dac: ad3552r-hs: add support for internal ramp Angelo Dureghello
2025-04-06  9:20   ` 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=20250406102008.0ebcbf9e@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=adureghello@baylibre.com \
    --cc=corbet@lwn.net \
    --cc=lars@metafoo.de \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=olivier.moysan@foss.st.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