Linux-IIO Archive mirror
 help / color / mirror / Atom feed
From: David Lechner <dlechner@baylibre.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: "Mark Brown" <broonie@kernel.org>,
	"Julien Stephan" <jstephan@baylibre.com>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Liam Girdwood" <lgirdwood@gmail.com>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, "kernel test robot" <lkp@intel.com>
Subject: Re: [PATCH v5 4/7] iio: adc: ad7380: add support for pseudo-differential parts
Date: Mon, 25 Mar 2024 15:14:19 -0500	[thread overview]
Message-ID: <CAMknhBHNhL62A8KY3vnNqQm+c+5M-0=w3qAWN=54FxYGjicUQw@mail.gmail.com> (raw)
In-Reply-To: <20240325200625.5a07cec4@jic23-huawei>

On Mon, Mar 25, 2024 at 3:06 PM Jonathan Cameron <jic23@kernel.org> wrote:
>
> >
> > But given that this is a common pattern in many IIO drivers, maybe we
> > make a devm_regulator_get_enable_get_voltage()? This would return the
> > voltage on success or an error code. (If the regulator subsystem
> > doesn't want this maybe we could have
> > devm_iio_regulator_get_enable_get_voltage()).
> >
> > If the dev_err_probe() calls were included in
> > devm_regulator_get_enable_get_voltage(), then the 10+ lines of code
> > here and in many other drivers to get the regulator, enable it, add
> > the reset action and get the voltage could be reduced to 3 lines.
>
> I like this proposal a lot. RFC, so it's visible outside the depths
> of this thread?

Yes, I can send an RFC separately so it doesn't hold up this patch/series.

> Particularly good as it will keep the regulator opaque in the same
> fashion as devm_regulator_get_enabled()
>
> As you say, we have a 'lot' of instances of this (quick grep
> suggests > 50 in IIO alone and smaller numbers elsewhere).
>

  reply	other threads:[~2024-03-25 20:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-19 10:11 [PATCH v5 0/7] iio: adc: add new ad7380 driver Julien Stephan
2024-03-19 10:11 ` [PATCH v5 1/7] dt-bindings: iio: adc: Add binding for AD7380 ADCs Julien Stephan
2024-03-19 10:11 ` [PATCH v5 2/7] iio: adc: ad7380: new driver " Julien Stephan
2024-03-24 12:42   ` Jonathan Cameron
2024-03-19 10:11 ` [PATCH v5 3/7] dt-bindings: iio: adc: ad7380: add pseudo-differential parts Julien Stephan
2024-03-19 17:10   ` Conor Dooley
2024-03-19 10:11 ` [PATCH v5 4/7] iio: adc: ad7380: add support for " Julien Stephan
2024-03-24 13:01   ` Jonathan Cameron
2024-03-25 14:08     ` David Lechner
2024-03-25 20:06       ` Jonathan Cameron
2024-03-25 20:14         ` David Lechner [this message]
2024-03-19 10:11 ` [PATCH v5 5/7] iio: adc: ad7380: prepare for parts with more channels Julien Stephan
2024-03-24 13:07   ` Jonathan Cameron
2024-03-19 10:11 ` [PATCH v5 6/7] dt-bindings: iio: adc: ad7380: add support for ad738x-4 4 channels variants Julien Stephan
2024-03-19 17:24   ` Conor Dooley
2024-03-19 10:11 ` [PATCH v5 7/7] " Julien Stephan
2024-03-24 13:10   ` Jonathan Cameron
2024-03-25 15:01     ` David Lechner
2024-03-25 19:04       ` Jonathan Cameron

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='CAMknhBHNhL62A8KY3vnNqQm+c+5M-0=w3qAWN=54FxYGjicUQw@mail.gmail.com' \
    --to=dlechner@baylibre.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=jstephan@baylibre.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=nuno.sa@analog.com \
    --cc=robh+dt@kernel.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).