From: Romain Gantois <romain.gantois@bootlin.com>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: "Liam Girdwood" <lgirdwood@gmail.com>,
"Mark Brown" <broonie@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Hans de Goede" <hansg@kernel.org>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
linux-iio@vger.kernel.org
Subject: Re: [PATCH v3 5/5] regulator: ltm8054: Support output current limit control
Date: Fri, 07 Nov 2025 15:54:28 +0100 [thread overview]
Message-ID: <13882660.uLZWGnKmhe@fw-rgant> (raw)
In-Reply-To: <aQzpvR-030zgA82E@smile.fi.intel.com>
[-- Attachment #1: Type: text/plain, Size: 1494 bytes --]
Hello Andy,
On Thursday, 6 November 2025 19:32:29 CET Andy Shevchenko wrote:
> On Thu, Nov 06, 2025 at 03:11:50PM +0100, Romain Gantois wrote:
> > The LTM8054 supports setting a fixed output current limit using a sense
> > resistor connected to a dedicated pin. This limit can then be lowered
> > dynamically by varying the voltage level of the CTL pin.
...
> > + ctl_dac = devm_iio_channel_get(&pdev->dev, "ctl");
> > + if (IS_ERR(ctl_dac)) {
> >
> > + if (PTR_ERR(ctl_dac) == -ENODEV)
> > + return ERR_PTR(-EPROBE_DEFER);
>
> Hmm... Are you sure about this?
The only case where I want to defer is if the IO channel hasn't been created
yet. From what I've read in iio_channel_get(), -ENODEV is returned specifically
in this case. For example in fwnode_iio_channel_get_by_name() you have:
```
if (!IS_ERR(chan) || PTR_ERR(chan) != -ENODEV)
return chan;
```
> >
> > priv->rdesc.type = REGULATOR_VOLTAGE;
> > priv->rdesc.owner = THIS_MODULE;
> >
> > + if (ctl_dac) {
> > + priv->ctl_dac = ctl_dac;
> >
> > + INIT_WORK(&priv->ctl_work.work, ltm8054_do_ctl_work);
> > + init_completion(&priv->ctl_rw_done);
>
> Do devm-helpers.h APIs help with something here? Does
> devm_add_action_or_reset() help with not covered cases?
I could definitely use a cleanup action to flush the ctl pin work item instead
of doing it in a remove() function. It would also remove the gotos below.
Thanks,
--
Romain Gantois, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2025-11-07 14:54 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-06 14:11 [PATCH v3 0/5] Add support for the LTM8054 voltage regulator Romain Gantois
2025-11-06 14:11 ` [PATCH v3 1/5] regulator: dt-bindings: Add Linear Technology LTM8054 regulator Romain Gantois
2025-11-06 17:23 ` Conor Dooley
2025-11-06 14:11 ` [PATCH v3 2/5] iio: add processed write API Romain Gantois
2025-11-06 16:07 ` Andy Shevchenko
2025-11-18 15:16 ` Romain Gantois
2025-11-18 15:30 ` Andy Shevchenko
2025-11-18 18:21 ` Jonathan Cameron
2025-11-06 14:11 ` [PATCH v3 3/5] iio: test: Add kunit tests for iio_divide_by_value() Romain Gantois
2025-11-06 16:10 ` Andy Shevchenko
2025-11-06 14:11 ` [PATCH v3 4/5] regulator: Support the LTM8054 voltage regulator Romain Gantois
2025-11-06 18:08 ` Andy Shevchenko
2025-11-06 14:11 ` [PATCH v3 5/5] regulator: ltm8054: Support output current limit control Romain Gantois
2025-11-06 18:32 ` Andy Shevchenko
2025-11-07 14:54 ` Romain Gantois [this message]
2025-11-07 15:28 ` Andy Shevchenko
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=13882660.uLZWGnKmhe@fw-rgant \
--to=romain.gantois@bootlin.com \
--cc=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=hansg@kernel.org \
--cc=jic23@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=robh@kernel.org \
--cc=thomas.petazzoni@bootlin.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;
as well as URLs for NNTP newsgroup(s).