From: Adrian Hunter <adrian.hunter@intel.com>
To: Alexander Stein <alexander.stein@ew.tq-group.com>,
Vignesh Raghavendra <vigneshr@ti.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Tony Lindgren <tony@atomide.com>
Cc: Matthias Schiffer <matthias.schiffer@tq-group.com>,
<linux-mmc@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/2] mmc: sdhci-omap: properly check regulator_is_supported_voltage() return
Date: Fri, 29 Aug 2025 07:55:14 +0300 [thread overview]
Message-ID: <dba29577-c685-40bb-8bed-482aad351edc@intel.com> (raw)
In-Reply-To: <20250825122149.2169502-1-alexander.stein@ew.tq-group.com>
On 25/08/2025 15:21, Alexander Stein wrote:
> From: Matthias Schiffer <matthias.schiffer@tq-group.com>
>
> regulator_is_supported_voltage() returns negative values on errors.
>
> Note that this patch might result in regressions on existing boards that
> should support voltage switching, but don't have their regulators set up
> correctly.
>
> Fixes: de5ccd2af71f ("mmc: sdhci-omap: Handle voltages to add support omap4")
It is not very clear what is being fixed nor why.
It changes from "setting a capability if there is an error" to
"not setting a capability if there is an error". Both seem less
than ideal.
Also "might result in regressions" is really not suitable for
stable, which is probably where it will end up if it has a Fixes tag.
> Signed-off-by: Matthias Schiffer <matthias.schiffer@tq-group.com>
> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> ---
> New in v2
>
> drivers/mmc/host/sdhci-omap.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c
> index b5d7c1a80a92f..08d5a82b7d01b 100644
> --- a/drivers/mmc/host/sdhci-omap.c
> +++ b/drivers/mmc/host/sdhci-omap.c
> @@ -949,11 +949,11 @@ static unsigned int sdhci_omap_regulator_get_caps(struct device *dev,
> if (IS_ERR(reg))
> return ~0U;
>
> - if (regulator_is_supported_voltage(reg, 1700000, 1950000))
> + if (regulator_is_supported_voltage(reg, 1700000, 1950000) > 0)
Why is the error ignored?
> caps |= SDHCI_CAN_VDD_180;
> - if (regulator_is_supported_voltage(reg, 2700000, 3150000))
> + if (regulator_is_supported_voltage(reg, 2700000, 3150000) > 0)
> caps |= SDHCI_CAN_VDD_300;
> - if (regulator_is_supported_voltage(reg, 3150000, 3600000))
> + if (regulator_is_supported_voltage(reg, 3150000, 3600000) > 0)
> caps |= SDHCI_CAN_VDD_330;
>
> regulator_put(reg);
prev parent reply other threads:[~2025-08-29 4:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-25 12:21 Alexander Stein
2025-08-25 12:21 ` [PATCH v2 2/2] mmc: sdhci-omap: use regulator_get_optional() and reuse pbias in sdhci_omap_regulator_get_caps() Alexander Stein
2025-08-29 6:11 ` Adrian Hunter
2025-08-29 4:55 ` Adrian Hunter [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=dba29577-c685-40bb-8bed-482aad351edc@intel.com \
--to=adrian.hunter@intel.com \
--cc=alexander.stein@ew.tq-group.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=matthias.schiffer@tq-group.com \
--cc=tony@atomide.com \
--cc=ulf.hansson@linaro.org \
--cc=vigneshr@ti.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
all inboxes | Powered by JetHome®