summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>2026-01-02 15:48:28 +0300
committerMathieu Poirier <mathieu.poirier@linaro.org>2026-01-06 00:28:33 +0300
commit6d183d0530b5dc77ddd7d829bdfcb62a365a210f (patch)
treea5f5e3d5c709d6b276962267467794343e16013d
parentb490ddf27be28e64a39c08ae643d7b22561beaf6 (diff)
downloadlinux-6d183d0530b5dc77ddd7d829bdfcb62a365a210f.tar.xz
remoteproc: mtk_scp: 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-3-krzysztof.kozlowski@oss.qualcomm.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
-rw-r--r--drivers/remoteproc/mtk_scp.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
index db8fd045468d..328541e62158 100644
--- a/drivers/remoteproc/mtk_scp.c
+++ b/drivers/remoteproc/mtk_scp.c
@@ -1287,7 +1287,6 @@ static int scp_add_multi_core(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 list_head *scp_list = &scp_cluster->mtk_scp_list;
const struct mtk_scp_of_data **cluster_of_data;
struct mtk_scp *scp, *temp;
@@ -1296,11 +1295,10 @@ static int scp_add_multi_core(struct platform_device *pdev,
cluster_of_data = (const struct mtk_scp_of_data **)of_device_get_match_data(dev);
- for_each_available_child_of_node(np, child) {
+ for_each_available_child_of_node_scoped(np, child) {
if (!cluster_of_data[core_id]) {
ret = -EINVAL;
dev_err(dev, "Not support core %d\n", core_id);
- of_node_put(child);
goto init_fail;
}
@@ -1308,7 +1306,6 @@ static int scp_add_multi_core(struct platform_device *pdev,
if (!cpdev) {
ret = -ENODEV;
dev_err(dev, "Not found platform device for core %d\n", core_id);
- of_node_put(child);
goto init_fail;
}
@@ -1317,14 +1314,12 @@ static int scp_add_multi_core(struct platform_device *pdev,
if (IS_ERR(scp)) {
ret = PTR_ERR(scp);
dev_err(dev, "Failed to initialize core %d rproc\n", core_id);
- of_node_put(child);
goto init_fail;
}
ret = rproc_add(scp->rproc);
if (ret) {
dev_err(dev, "Failed to add rproc of core %d\n", core_id);
- of_node_put(child);
scp_free(scp);
goto init_fail;
}