* [PATCH] slimbus: qcom-ngd: Simplify with scoped for each OF child loop
@ 2026-01-16 17:09 srini
0 siblings, 0 replies; 4+ messages in thread
From: srini @ 2026-01-16 17:09 UTC (permalink / raw)
To: gregkh
Cc: linux-kernel, Krzysztof Kozlowski, Konrad Dybcio, Srinivas Kandagatla
From: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Use scoped for-each loop when iterating over device nodes to make code a
bit simpler.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
---
Hi Greg,
Here is one slimbus patch which can go for 6.20
If its not too late, could you please queue these as 6.20 material.
Thanks,
Srini
drivers/slimbus/qcom-ngd-ctrl.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c
index ba3d80d12605..7338b38697d0 100644
--- a/drivers/slimbus/qcom-ngd-ctrl.c
+++ b/drivers/slimbus/qcom-ngd-ctrl.c
@@ -1514,26 +1514,22 @@ static int of_qcom_slim_ngd_register(struct device *parent,
const struct ngd_reg_offset_data *data;
struct qcom_slim_ngd *ngd;
const struct of_device_id *match;
- struct device_node *node;
u32 id;
int ret;
match = of_match_node(qcom_slim_ngd_dt_match, parent->of_node);
data = match->data;
- for_each_available_child_of_node(parent->of_node, node) {
+ for_each_available_child_of_node_scoped(parent->of_node, node) {
if (of_property_read_u32(node, "reg", &id))
continue;
ngd = kzalloc(sizeof(*ngd), GFP_KERNEL);
- if (!ngd) {
- of_node_put(node);
+ if (!ngd)
return -ENOMEM;
- }
ngd->pdev = platform_device_alloc(QCOM_SLIM_NGD_DRV_NAME, id);
if (!ngd->pdev) {
kfree(ngd);
- of_node_put(node);
return -ENOMEM;
}
ngd->id = id;
@@ -1546,7 +1542,6 @@ static int of_qcom_slim_ngd_register(struct device *parent,
if (ret) {
platform_device_put(ngd->pdev);
kfree(ngd);
- of_node_put(node);
return ret;
}
ngd->pdev->dev.of_node = node;
@@ -1556,7 +1551,6 @@ static int of_qcom_slim_ngd_register(struct device *parent,
if (ret) {
platform_device_put(ngd->pdev);
kfree(ngd);
- of_node_put(node);
return ret;
}
ngd->base = ctrl->base + ngd->id * data->offset +
--
2.51.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] slimbus: qcom-ngd: Simplify with scoped for each OF child loop
2026-01-02 12:48 Krzysztof Kozlowski
2026-01-02 14:06 ` Konrad Dybcio
@ 2026-01-05 7:53 ` Srinivas Kandagatla
1 sibling, 0 replies; 4+ messages in thread
From: Srinivas Kandagatla @ 2026-01-05 7:53 UTC (permalink / raw)
To: linux-arm-msm, linux-sound, linux-kernel, Krzysztof Kozlowski
On Fri, 02 Jan 2026 13:48:09 +0100, Krzysztof Kozlowski wrote:
> Use scoped for-each loop when iterating over device nodes to make code a
> bit simpler.
>
>
Applied, thanks!
[1/1] slimbus: qcom-ngd: Simplify with scoped for each OF child loop
commit: 6af1ec752dd456ffbff48fa3c9f717470ae83e9e
Best regards,
--
Srinivas Kandagatla <srini@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] slimbus: qcom-ngd: Simplify with scoped for each OF child loop
2026-01-02 12:48 Krzysztof Kozlowski
@ 2026-01-02 14:06 ` Konrad Dybcio
2026-01-05 7:53 ` Srinivas Kandagatla
1 sibling, 0 replies; 4+ messages in thread
From: Konrad Dybcio @ 2026-01-02 14:06 UTC (permalink / raw)
To: Krzysztof Kozlowski, Srinivas Kandagatla, linux-arm-msm,
linux-sound, linux-kernel
On 1/2/26 1:48 PM, Krzysztof Kozlowski wrote:
> Use scoped for-each loop when iterating over device nodes to make code a
> bit simpler.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] slimbus: qcom-ngd: Simplify with scoped for each OF child loop
@ 2026-01-02 12:48 Krzysztof Kozlowski
2026-01-02 14:06 ` Konrad Dybcio
2026-01-05 7:53 ` Srinivas Kandagatla
0 siblings, 2 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2026-01-02 12:48 UTC (permalink / raw)
To: Srinivas Kandagatla, linux-arm-msm, linux-sound, linux-kernel
Cc: Krzysztof Kozlowski
Use scoped for-each loop when iterating over device nodes to make code a
bit simpler.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
drivers/slimbus/qcom-ngd-ctrl.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c
index ba3d80d12605..7338b38697d0 100644
--- a/drivers/slimbus/qcom-ngd-ctrl.c
+++ b/drivers/slimbus/qcom-ngd-ctrl.c
@@ -1514,26 +1514,22 @@ static int of_qcom_slim_ngd_register(struct device *parent,
const struct ngd_reg_offset_data *data;
struct qcom_slim_ngd *ngd;
const struct of_device_id *match;
- struct device_node *node;
u32 id;
int ret;
match = of_match_node(qcom_slim_ngd_dt_match, parent->of_node);
data = match->data;
- for_each_available_child_of_node(parent->of_node, node) {
+ for_each_available_child_of_node_scoped(parent->of_node, node) {
if (of_property_read_u32(node, "reg", &id))
continue;
ngd = kzalloc(sizeof(*ngd), GFP_KERNEL);
- if (!ngd) {
- of_node_put(node);
+ if (!ngd)
return -ENOMEM;
- }
ngd->pdev = platform_device_alloc(QCOM_SLIM_NGD_DRV_NAME, id);
if (!ngd->pdev) {
kfree(ngd);
- of_node_put(node);
return -ENOMEM;
}
ngd->id = id;
@@ -1546,7 +1542,6 @@ static int of_qcom_slim_ngd_register(struct device *parent,
if (ret) {
platform_device_put(ngd->pdev);
kfree(ngd);
- of_node_put(node);
return ret;
}
ngd->pdev->dev.of_node = node;
@@ -1556,7 +1551,6 @@ static int of_qcom_slim_ngd_register(struct device *parent,
if (ret) {
platform_device_put(ngd->pdev);
kfree(ngd);
- of_node_put(node);
return ret;
}
ngd->base = ctrl->base + ngd->id * data->offset +
--
2.51.0
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-01-16 17:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-16 17:09 [PATCH] slimbus: qcom-ngd: Simplify with scoped for each OF child loop srini
-- strict thread matches above, loose matches on Subject: below --
2026-01-02 12:48 Krzysztof Kozlowski
2026-01-02 14:06 ` Konrad Dybcio
2026-01-05 7:53 ` Srinivas Kandagatla
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®