* [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
* [PATCH 2/2] regulator: qcom_spmi: Use of_property_read_bool()
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 ` 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
2 siblings, 1 reply; 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
Use of_property_read_bool() to read boolean properties rather than
of_find_property(). This is part of a larger effort to remove callers
of of_find_property() and similar functions. of_find_property() leaks
the DT property pointer which is a problem for dynamically allocated
nodes which may be freed.
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
---
drivers/regulator/qcom_spmi-regulator.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/regulator/qcom_spmi-regulator.c b/drivers/regulator/qcom_spmi-regulator.c
index 68603649db48..89657e8eea82 100644
--- a/drivers/regulator/qcom_spmi-regulator.c
+++ b/drivers/regulator/qcom_spmi-regulator.c
@@ -2577,15 +2577,13 @@ static int qcom_spmi_regulator_probe(struct platform_device *pdev)
if (saw_regmap) {
reg_node = of_get_child_by_name(node, reg->name);
- reg_prop = of_find_property(reg_node, "qcom,saw-leader",
- &lenp);
- of_node_put(reg_node);
- if (reg_prop) {
+ if (of_property_read_bool(reg_node, "qcom,saw-leader")) {
spmi_saw_ops = *(vreg->desc.ops);
spmi_saw_ops.set_voltage_sel =
spmi_regulator_saw_set_voltage;
vreg->desc.ops = &spmi_saw_ops;
}
+ of_node_put(reg_node);
}
if (vreg->set_points && vreg->set_points->count == 1) {
--
2.45.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] regulator: qcom_spmi: Drop unnecessary of_find_property() call
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 12:09 ` Mark Brown
2 siblings, 0 replies; 5+ messages in thread
From: Dmitry Baryshkov @ 2024-08-29 10:09 UTC (permalink / raw)
To: Rob Herring (Arm); +Cc: Liam Girdwood, Mark Brown, linux-arm-msm, linux-kernel
On Wed, Aug 28, 2024 at 08:00:54AM GMT, Rob Herring (Arm) wrote:
> 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(-)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] regulator: qcom_spmi: Use of_property_read_bool()
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
0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Baryshkov @ 2024-08-29 10:09 UTC (permalink / raw)
To: Rob Herring (Arm); +Cc: Liam Girdwood, Mark Brown, linux-arm-msm, linux-kernel
On Wed, Aug 28, 2024 at 08:00:55AM GMT, Rob Herring (Arm) wrote:
> Use of_property_read_bool() to read boolean properties rather than
> of_find_property(). This is part of a larger effort to remove callers
> of of_find_property() and similar functions. of_find_property() leaks
> the DT property pointer which is a problem for dynamically allocated
> nodes which may be freed.
>
> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
> ---
> drivers/regulator/qcom_spmi-regulator.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] regulator: qcom_spmi: Drop unnecessary of_find_property() call
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 ` [PATCH 1/2] regulator: qcom_spmi: Drop unnecessary of_find_property() call Dmitry Baryshkov
@ 2024-08-29 12:09 ` Mark Brown
2 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2024-08-29 12:09 UTC (permalink / raw)
To: Liam Girdwood, Rob Herring (Arm); +Cc: linux-arm-msm, linux-kernel
On Wed, 28 Aug 2024 08:00:54 -0500, Rob Herring (Arm) wrote:
> 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.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
Thanks!
[1/2] regulator: qcom_spmi: Drop unnecessary of_find_property() call
commit: 7540bd3398675e54cbd7324c47be8cd3c7a6d9c5
[2/2] regulator: qcom_spmi: Use of_property_read_bool()
commit: dd72a3b8a6007b44ed3b85e1d606afc434879e70
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [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