Skip to content

Commit 56cb268

Browse files
storulfrafaeljw
authored andcommitted
PM / Domains: Allow no domain-idle-states DT property in genpd when parsing
Commit 2c36168 ("PM / Domains: Don't treat zero found compatible idle states as an error"), moved of_genpd_parse_idle_states() towards allowing none compatible idle state to be found for the device node, rather than returning an error code. However, it didn't consider that the "domain-idle-states" DT property may be missing as it's optional, which makes of_count_phandle_with_args() to return -ENOENT. Let's fix this to make the behaviour consistent. Fixes: 2c36168 ("PM / Domains: Don't treat zero found compatible idle states as an error") Reported-by: Benjamin Gaignard <[email protected]> Cc: 4.20+ <[email protected]> # 4.20+ Reviewed-by: Sudeep Holla <[email protected]> Signed-off-by: Ulf Hansson <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 2c523b3 commit 56cb268

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/base/power/domain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2653,7 +2653,7 @@ static int genpd_iterate_idle_states(struct device_node *dn,
26532653

26542654
ret = of_count_phandle_with_args(dn, "domain-idle-states", NULL);
26552655
if (ret <= 0)
2656-
return ret;
2656+
return ret == -ENOENT ? 0 : ret;
26572657

26582658
/* Loop over the phandles until all the requested entry is found */
26592659
of_for_each_phandle(&it, ret, dn, "domain-idle-states", NULL, 0) {

0 commit comments

Comments
 (0)