[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <13882660.uLZWGnKmhe@fw-rgant>
Date: Fri, 07 Nov 2025 15:54:28 +0100
From: Romain Gantois <romain.gantois@...tlin.com>
To: Andy Shevchenko <andriy.shevchenko@...el.com>
Cc: Liam Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Jonathan Cameron <jic23@...nel.org>,
David Lechner <dlechner@...libre.com>,
Nuno Sá <nuno.sa@...log.com>,
Andy Shevchenko <andy@...nel.org>, Hans de Goede <hansg@...nel.org>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
linux-iio@...r.kernel.org
Subject:
Re: [PATCH v3 5/5] regulator: ltm8054: Support output current limit control
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
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists