diff options
author | Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> | 2024-10-11 15:09:12 +0200 |
---|---|---|
committer | Mathieu Poirier <mathieu.poirier@linaro.org> | 2024-10-15 19:42:59 +0200 |
commit | f5964cecd91fad55e732ded94bb7b9168ee0c294 (patch) | |
tree | f02dd1bcefdabea921b1591a3855735f7335412b /drivers/remoteproc | |
parent | remoteproc: ti_k3_r5: Simplify with dev_err_probe() (diff) | |
download | linux-f5964cecd91fad55e732ded94bb7b9168ee0c294.tar.xz linux-f5964cecd91fad55e732ded94bb7b9168ee0c294.zip |
remoteproc: ti_k3_r5: Simplify with scoped for each OF child loop
Use scoped for_each_available_child_of_node_scoped() when iterating over
device nodes to make code a bit simpler.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20241011-remote-proc-dev-err-probe-v1-4-5abb4fc61eca@linaro.org
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Diffstat (limited to 'drivers/remoteproc')
-rw-r--r-- | drivers/remoteproc/ti_k3_r5_remoteproc.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/remoteproc/ti_k3_r5_remoteproc.c b/drivers/remoteproc/ti_k3_r5_remoteproc.c index 5a2e0464e1b8..2f996a962f55 100644 --- a/drivers/remoteproc/ti_k3_r5_remoteproc.c +++ b/drivers/remoteproc/ti_k3_r5_remoteproc.c @@ -1650,16 +1650,14 @@ static int k3_r5_cluster_of_init(struct platform_device *pdev) struct device *dev = &pdev->dev; struct device_node *np = dev_of_node(dev); struct platform_device *cpdev; - struct device_node *child; struct k3_r5_core *core; int ret; - for_each_available_child_of_node(np, child) { + for_each_available_child_of_node_scoped(np, child) { cpdev = of_find_device_by_node(child); if (!cpdev) { ret = -ENODEV; dev_err(dev, "could not get R5 core platform device\n"); - of_node_put(child); goto fail; } @@ -1668,7 +1666,6 @@ static int k3_r5_cluster_of_init(struct platform_device *pdev) dev_err(dev, "k3_r5_core_of_init failed, ret = %d\n", ret); put_device(&cpdev->dev); - of_node_put(child); goto fail; } |