summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>2026-01-02 13:48:41 +0100
committerUlf Hansson <ulf.hansson@linaro.org>2026-04-01 13:07:31 +0200
commitecd2f0eaffad8cb8245d11b64bb1ccc7a40da565 (patch)
tree603712d0f5649740c9f4c40f9d5a4adc879cc7d2
parentadff6abbdcf9ecabd9bdf299ace6b5f85160e5f4 (diff)
pmdomain: mediatek: 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> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r--drivers/pmdomain/mediatek/mtk-pm-domains.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/pmdomain/mediatek/mtk-pm-domains.c b/drivers/pmdomain/mediatek/mtk-pm-domains.c
index e2800aa1bc59..46b1869093b6 100644
--- a/drivers/pmdomain/mediatek/mtk-pm-domains.c
+++ b/drivers/pmdomain/mediatek/mtk-pm-domains.c
@@ -1182,7 +1182,6 @@ static int scpsys_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct device_node *np = dev->of_node;
const struct scpsys_soc_data *soc;
- struct device_node *node;
struct device *parent;
struct scpsys *scpsys;
int num_domains, ret;
@@ -1226,21 +1225,18 @@ static int scpsys_probe(struct platform_device *pdev)
return ret;
ret = -ENODEV;
- for_each_available_child_of_node(np, node) {
+ for_each_available_child_of_node_scoped(np, node) {
struct generic_pm_domain *domain;
domain = scpsys_add_one_domain(scpsys, node);
if (IS_ERR(domain)) {
ret = PTR_ERR(domain);
- of_node_put(node);
goto err_cleanup_domains;
}
ret = scpsys_add_subdomain(scpsys, node);
- if (ret) {
- of_node_put(node);
+ if (ret)
goto err_cleanup_domains;
- }
}
if (ret) {