Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
* [PATCH 1/2] regulator: qcom_spmi: Drop unnecessary of_find_property() call
@ 2024-08-28 13:00 Rob Herring (Arm)
  2024-08-28 13:00 ` [PATCH 2/2] regulator: qcom_spmi: Use of_property_read_bool() Rob Herring (Arm)
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Rob Herring (Arm) @ 2024-08-28 13:00 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown; +Cc: linux-arm-msm, linux-kernel

There's no need to check for presence of "qcom,saw-reg" before parsing
it. If the property doesn't exist, parsing it will return NULL.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
---
 drivers/regulator/qcom_spmi-regulator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/qcom_spmi-regulator.c b/drivers/regulator/qcom_spmi-regulator.c
index 9a9fa20dcd95..68603649db48 100644
--- a/drivers/regulator/qcom_spmi-regulator.c
+++ b/drivers/regulator/qcom_spmi-regulator.c
@@ -2528,8 +2528,8 @@ static int qcom_spmi_regulator_probe(struct platform_device *pdev)
 	if (!reg)
 		return -ENODEV;
 
-	if (of_find_property(node, "qcom,saw-reg", &lenp)) {
-		syscon = of_parse_phandle(node, "qcom,saw-reg", 0);
+	syscon = of_parse_phandle(node, "qcom,saw-reg", 0);
+	if (syscon) {
 		saw_regmap = syscon_node_to_regmap(syscon);
 		of_node_put(syscon);
 		if (IS_ERR(saw_regmap))
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-08-29 12:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-28 13:00 [PATCH 1/2] regulator: qcom_spmi: Drop unnecessary of_find_property() call Rob Herring (Arm)
2024-08-28 13:00 ` [PATCH 2/2] regulator: qcom_spmi: Use of_property_read_bool() Rob Herring (Arm)
2024-08-29 10:09   ` Dmitry Baryshkov
2024-08-29 10:09 ` [PATCH 1/2] regulator: qcom_spmi: Drop unnecessary of_find_property() call Dmitry Baryshkov
2024-08-29 12:09 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox