Skip to content

Commit 5e53636

Browse files
Zhang Zekunstorulf
authored andcommitted
genpd: ti: Use for_each_node_with_property() simplify code logic
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>
1 parent f6e35a6 commit 5e53636

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

drivers/genpd/ti/ti_sci_pm_domains.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ static int ti_sci_pm_domain_probe(struct platform_device *pdev)
119119
struct device *dev = &pdev->dev;
120120
struct ti_sci_genpd_provider *pd_provider;
121121
struct ti_sci_pm_domain *pd;
122-
struct device_node *np = NULL;
122+
struct device_node *np;
123123
struct of_phandle_args args;
124124
int ret;
125125
u32 max_id = 0;
@@ -138,11 +138,7 @@ static int ti_sci_pm_domain_probe(struct platform_device *pdev)
138138
INIT_LIST_HEAD(&pd_provider->pd_list);
139139

140140
/* Find highest device ID used for power domains */
141-
while (1) {
142-
np = of_find_node_with_property(np, "power-domains");
143-
if (!np)
144-
break;
145-
141+
for_each_node_with_property(np, "power-domains") {
146142
index = 0;
147143

148144
while (1) {

0 commit comments

Comments
 (0)