From: Jonathan Cameron <jic23@kernel.org>
To: "Rob Herring (Arm)" <robh@kernel.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
linux-iio@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: adc: stm32: Drop unnecessary DT property presence check
Date: Sun, 12 Jan 2025 15:26:51 +0000 [thread overview]
Message-ID: <20250112152651.30b343dd@jic23-huawei> (raw)
In-Reply-To: <20250109182325.3973684-2-robh@kernel.org>
On Thu, 9 Jan 2025 12:23:25 -0600
"Rob Herring (Arm)" <robh@kernel.org> wrote:
> There's no reason to check for regulator supply property presence before
> calling devm_regulator_get_optional() as that will return -ENODEV if
> the supply is not present.
>
> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
> ---
> The diff context doesn't show it, but the next line returns on error
> other than -ENODEV.
Thanks for that. Saved me opening the file.
Applied to the testing branch of iio.git. Probably next cycle material now.
Jonathan
>
> drivers/iio/adc/stm32-adc-core.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/iio/adc/stm32-adc-core.c b/drivers/iio/adc/stm32-adc-core.c
> index 2201ee9987ae..0914148d1a22 100644
> --- a/drivers/iio/adc/stm32-adc-core.c
> +++ b/drivers/iio/adc/stm32-adc-core.c
> @@ -615,8 +615,7 @@ static int stm32_adc_core_switches_probe(struct device *dev,
> }
>
> /* Booster can be used to supply analog switches (optional) */
> - if (priv->cfg->has_syscfg & HAS_VBOOSTER &&
> - of_property_read_bool(np, "booster-supply")) {
> + if (priv->cfg->has_syscfg & HAS_VBOOSTER) {
> priv->booster = devm_regulator_get_optional(dev, "booster");
> if (IS_ERR(priv->booster)) {
> ret = PTR_ERR(priv->booster);
> @@ -628,8 +627,7 @@ static int stm32_adc_core_switches_probe(struct device *dev,
> }
>
> /* Vdd can be used to supply analog switches (optional) */
> - if (priv->cfg->has_syscfg & HAS_ANASWVDD &&
> - of_property_read_bool(np, "vdd-supply")) {
> + if (priv->cfg->has_syscfg & HAS_ANASWVDD) {
> priv->vdd = devm_regulator_get_optional(dev, "vdd");
> if (IS_ERR(priv->vdd)) {
> ret = PTR_ERR(priv->vdd);
prev parent reply other threads:[~2025-01-12 15:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-09 18:23 [PATCH] iio: adc: stm32: Drop unnecessary DT property presence check Rob Herring (Arm)
2025-01-10 11:18 ` Fabrice Gasnier
2025-01-12 15:26 ` 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=20250112152651.30b343dd@jic23-huawei \
--to=jic23@kernel.org \
--cc=alexandre.torgue@foss.st.com \
--cc=broonie@kernel.org \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=robh@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