summaryrefslogtreecommitdiff
path: root/drivers/remoteproc
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>2026-01-02 13:48:29 +0100
committerMathieu Poirier <mathieu.poirier@linaro.org>2026-01-05 14:31:34 -0700
commit88c31f1b31aec2d73261d9565f870e8d14974543 (patch)
tree6113c9ac281027c20d6dd501fac67fc6733a5f3d /drivers/remoteproc
parent6d183d0530b5dc77ddd7d829bdfcb62a365a210f (diff)
remoteproc: xlnx_r5: Simplify with scoped for each OF child loop
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> Link: https://lore.kernel.org/r/20260102124827.64355-4-krzysztof.kozlowski@oss.qualcomm.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Diffstat (limited to 'drivers/remoteproc')
-rw-r--r--drivers/remoteproc/xlnx_r5_remoteproc.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/remoteproc/xlnx_r5_remoteproc.c b/drivers/remoteproc/xlnx_r5_remoteproc.c
index a7b75235f53e..bd619a6c42aa 100644
--- a/drivers/remoteproc/xlnx_r5_remoteproc.c
+++ b/drivers/remoteproc/xlnx_r5_remoteproc.c
@@ -1271,7 +1271,6 @@ static int zynqmp_r5_cluster_init(struct zynqmp_r5_cluster *cluster)
struct zynqmp_r5_core **r5_cores;
enum rpu_oper_mode fw_reg_val;
struct device **child_devs;
- struct device_node *child;
enum rpu_tcm_comb tcm_mode;
int core_count, ret, i;
struct mbox_info *ipi;
@@ -1350,10 +1349,9 @@ static int zynqmp_r5_cluster_init(struct zynqmp_r5_cluster *cluster)
}
i = 0;
- for_each_available_child_of_node(dev_node, child) {
+ for_each_available_child_of_node_scoped(dev_node, child) {
child_pdev = of_find_device_by_node(child);
if (!child_pdev) {
- of_node_put(child);
ret = -ENODEV;
goto release_r5_cores;
}
@@ -1363,7 +1361,6 @@ static int zynqmp_r5_cluster_init(struct zynqmp_r5_cluster *cluster)
/* create and add remoteproc instance of type struct rproc */
r5_cores[i] = zynqmp_r5_add_rproc_core(&child_pdev->dev);
if (IS_ERR(r5_cores[i])) {
- of_node_put(child);
ret = PTR_ERR(r5_cores[i]);
r5_cores[i] = NULL;
goto release_r5_cores;
@@ -1383,10 +1380,8 @@ static int zynqmp_r5_cluster_init(struct zynqmp_r5_cluster *cluster)
* If two child nodes are available in dts in lockstep mode,
* then ignore second child node.
*/
- if (cluster_mode == LOCKSTEP_MODE) {
- of_node_put(child);
+ if (cluster_mode == LOCKSTEP_MODE)
break;
- }
i++;
}