From: Andre Przywara <andre.przywara@arm.com>
To: Shengyu Qu <wiagn233@outlook.com>
Cc: lee@kernel.org, robh+dt@kernel.org,
krzysztof.kozlowski+dt@linaro.org, wens@csie.org,
lgirdwood@gmail.com, broonie@kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Martin Botka <martin.botka@somainline.org>
Subject: Re: [PATCH v1 4/4] regulator: axp20x: Set DCDC frequency only when property exists
Date: Mon, 17 Apr 2023 15:20:20 +0100 [thread overview]
Message-ID: <20230417152020.419bfb9c@donnerap.cambridge.arm.com> (raw)
In-Reply-To: <TY3P286MB26111D00F42888C71EF0877698969@TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM>
On Fri, 7 Apr 2023 22:18:13 +0800
Shengyu Qu <wiagn233@outlook.com> wrote:
> Current axp20x regulator driver would always set DCDC frequency even if
> there is no x-powers,dcdc-freq in device tree data. Causing meaningless
> warning info output on variants that do not support DCDC frequency
> modification. So only try to set DCDC frequency when there is frequency
> property.
This patch should not be needed. You should disallow the
x-powers,dcdc-freq property in the binding (see [1]), then handle that
like the AXP313a driver does: by explicitly checking that the property
does not exist, then returning, see [2].
In general you might want to rebase your series on top of the AXP313a v10
series, as this most likely goes in before.
Cheers,
Andre
[1]
https://lore.kernel.org/linux-sunxi/20230401001850.4988-2-andre.przywara@arm.com/
[2]
https://lore.kernel.org/linux-sunxi/20230401001850.4988-4-andre.przywara@arm.com/
> Signed-off-by: Shengyu Qu <wiagn233@outlook.com>
> ---
> drivers/regulator/axp20x-regulator.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
> index ece4af93df7b..12a12923bc7b 100644
> --- a/drivers/regulator/axp20x-regulator.c
> +++ b/drivers/regulator/axp20x-regulator.c
> @@ -1247,10 +1247,10 @@ static int axp20x_regulator_parse_dt(struct platform_device *pdev)
> if (!regulators) {
> dev_warn(&pdev->dev, "regulators node not found\n");
> } else {
> - of_property_read_u32(regulators, "x-powers,dcdc-freq", &dcdcfreq);
> - ret = axp20x_set_dcdc_freq(pdev, dcdcfreq);
> - if (ret < 0) {
> - dev_err(&pdev->dev, "Error setting dcdc frequency: %d\n", ret);
> + if (of_property_read_u32(regulators, "x-powers,dcdc-freq", &dcdcfreq) != -EINVAL) {
> + ret = axp20x_set_dcdc_freq(pdev, dcdcfreq);
> + if (ret < 0)
> + dev_err(&pdev->dev, "Error setting dcdc frequency: %d\n", ret);
> }
> of_node_put(regulators);
> }
next prev parent reply other threads:[~2023-04-17 14:20 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230407141813.89-1-wiagn233@outlook.com>
2023-04-07 14:18 ` [PATCH v1 1/4] dt-bindings: mfd: x-powers,axp152: Document the AXP15060 variant Shengyu Qu
2023-04-10 17:27 ` Krzysztof Kozlowski
2023-04-10 17:43 ` Shengyu Qu
2023-04-07 14:18 ` [PATCH v1 2/4] mfd: axp20x: Add support for AXP15060 PMIC Shengyu Qu
2023-04-17 14:05 ` Andre Przywara
2023-04-17 16:21 ` Shengyu Qu
2023-04-07 14:18 ` [PATCH v1 3/4] regulator: axp20x: Add AXP15060 support Shengyu Qu
2023-04-17 14:18 ` Andre Przywara
2023-04-17 16:01 ` Shengyu Qu
2023-04-18 21:57 ` Andre Przywara
2023-04-07 14:18 ` [PATCH v1 4/4] regulator: axp20x: Set DCDC frequency only when property exists Shengyu Qu
2023-04-17 14:20 ` Andre Przywara [this message]
2023-04-17 16:31 ` Shengyu Qu
[not found] <20230407135717.17381-1-wiagn233@outlook.com>
2023-04-07 13:57 ` Shengyu Qu
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=20230417152020.419bfb9c@donnerap.cambridge.arm.com \
--to=andre.przywara@arm.com \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lee@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.botka@somainline.org \
--cc=robh+dt@kernel.org \
--cc=wens@csie.org \
--cc=wiagn233@outlook.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).