Commit 7aa1204d authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Ulf Hansson

cpuidle: psci: Simplify with scoped for each OF child loop

Use scoped for_each_child_of_node_scoped() when iterating over device
nodes to make code a bit simpler.
Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20240816150931.142208-1-krzysztof.kozlowski@linaro.orgSigned-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 9b37f971
...@@ -142,7 +142,6 @@ static const struct of_device_id psci_of_match[] = { ...@@ -142,7 +142,6 @@ static const struct of_device_id psci_of_match[] = {
static int psci_cpuidle_domain_probe(struct platform_device *pdev) static int psci_cpuidle_domain_probe(struct platform_device *pdev)
{ {
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
struct device_node *node;
bool use_osi = psci_has_osi_support(); bool use_osi = psci_has_osi_support();
int ret = 0, pd_count = 0; int ret = 0, pd_count = 0;
...@@ -153,15 +152,13 @@ static int psci_cpuidle_domain_probe(struct platform_device *pdev) ...@@ -153,15 +152,13 @@ static int psci_cpuidle_domain_probe(struct platform_device *pdev)
* Parse child nodes for the "#power-domain-cells" property and * Parse child nodes for the "#power-domain-cells" property and
* initialize a genpd/genpd-of-provider pair when it's found. * initialize a genpd/genpd-of-provider pair when it's found.
*/ */
for_each_child_of_node(np, node) { for_each_child_of_node_scoped(np, node) {
if (!of_property_present(node, "#power-domain-cells")) if (!of_property_present(node, "#power-domain-cells"))
continue; continue;
ret = psci_pd_init(node, use_osi); ret = psci_pd_init(node, use_osi);
if (ret) { if (ret)
of_node_put(node);
goto exit; goto exit;
}
pd_count++; pd_count++;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment