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 v2 4/4] regulator: axp20x: Set DCDC frequency only when property exists
Date: Mon, 17 Apr 2023 17:05:38 +0800	[thread overview]
Message-ID: <TY3P286MB2611527CD760DF6ED30A2901989C9@TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20230417090537.6052-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 a4564d3590aa..68a22e3e6e0e 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-17  9:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230417090537.6052-1-wiagn233@outlook.com>
2023-04-17  9:05 ` [PATCH v2 1/4] dt-bindings: mfd: x-powers,axp152: Document the AXP15060 variant Shengyu Qu
2023-04-18 16:11   ` Krzysztof Kozlowski
2023-04-24 12:08   ` Lee Jones
2023-04-24 15:54     ` Shengyu Qu
2023-04-17  9:05 ` [PATCH v2 2/4] mfd: axp20x: Add support for AXP15060 PMIC Shengyu Qu
2023-04-24 12:16   ` Lee Jones
2023-04-17  9:05 ` [PATCH v2 3/4] regulator: axp20x: Add AXP15060 support Shengyu Qu
2023-04-17  9:05 ` Shengyu Qu [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=TY3P286MB2611527CD760DF6ED30A2901989C9@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®