diff options
Diffstat (limited to 'drivers/pmdomain/qcom/cpr.c')
-rw-r--r-- | drivers/pmdomain/qcom/cpr.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/pmdomain/qcom/cpr.c b/drivers/pmdomain/qcom/cpr.c index c64e84a27cc7..1834b3861232 100644 --- a/drivers/pmdomain/qcom/cpr.c +++ b/drivers/pmdomain/qcom/cpr.c @@ -1054,14 +1054,14 @@ static unsigned long cpr_get_opp_hz_for_req(struct dev_pm_opp *ref, if (!ref_np) goto out_ref; - do { + for_each_available_child_of_node(desc_np, child_np) { of_node_put(child_req_np); - child_np = of_get_next_available_child(desc_np, child_np); child_req_np = of_parse_phandle(child_np, "required-opps", 0); - } while (child_np && child_req_np != ref_np); - - if (child_np && child_req_np == ref_np) - of_property_read_u64(child_np, "opp-hz", &rate); + if (child_req_np == ref_np) { + of_property_read_u64(child_np, "opp-hz", &rate); + break; + } + } of_node_put(child_req_np); of_node_put(child_np); |