mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shengyu Qu <wiagn233@outlook.com>
To: 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
Cc: Shengyu Qu <wiagn233@outlook.com>
Subject: [PATCH v1 4/4] regulator: axp20x: Set DCDC frequency only when property exists
Date: Fri,  7 Apr 2023 22:18:13 +0800	[thread overview]
Message-ID: <TY3P286MB26111D00F42888C71EF0877698969@TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20230407141813.89-1-wiagn233@outlook.com>

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.

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);
 	}
-- 
2.25.1


  parent reply	other threads:[~2023-04-07 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 ` Shengyu Qu [this message]
2023-04-17 14:20   ` [PATCH v1 4/4] regulator: axp20x: Set DCDC frequency only when property exists Andre Przywara
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=TY3P286MB26111D00F42888C71EF0877698969@TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM \
    --to=wiagn233@outlook.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=robh+dt@kernel.org \
    --cc=wens@csie.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

all inboxes | Powered by JetHome®