diff options
author | Zhang Zekun <zhangzekun11@huawei.com> | 2023-08-18 15:01:49 +0800 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2023-08-25 12:04:57 +0200 |
commit | 5e536362f6ab97f709c07bfda962a7bb036c2563 (patch) | |
tree | aeaea288c148dbc0388d8315b6362824b70aa793 | |
parent | f6e35a67c174e3776c51c88470f4061e786511ec (diff) |
genpd: ti: Use for_each_node_with_property() simplify code logicgenpd-v6.6
Let's convert to use for_each_node_with_property() to iterate through the
DT nodes, as to simplify the code logic a bit. No intended functional
change.
Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com>
Acked-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r-- | drivers/genpd/ti/ti_sci_pm_domains.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/genpd/ti/ti_sci_pm_domains.c b/drivers/genpd/ti/ti_sci_pm_domains.c index a33ec7eaf23d..34645104fe45 100644 --- a/drivers/genpd/ti/ti_sci_pm_domains.c +++ b/drivers/genpd/ti/ti_sci_pm_domains.c @@ -119,7 +119,7 @@ static int ti_sci_pm_domain_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct ti_sci_genpd_provider *pd_provider; struct ti_sci_pm_domain *pd; - struct device_node *np = NULL; + struct device_node *np; struct of_phandle_args args; int ret; u32 max_id = 0; @@ -138,11 +138,7 @@ static int ti_sci_pm_domain_probe(struct platform_device *pdev) INIT_LIST_HEAD(&pd_provider->pd_list); /* Find highest device ID used for power domains */ - while (1) { - np = of_find_node_with_property(np, "power-domains"); - if (!np) - break; - + for_each_node_with_property(np, "power-domains") { index = 0; while (1) { |