Skip to content
Snippets Groups Projects
Commit 15f03950 authored by David Arcari's avatar David Arcari
Browse files

thermal: of: Simplify thermal_of_should_bind with scoped for each OF child

JIRA: https://issues.redhat.com/browse/RHEL-79821



commit 69f3aa6ad92447d6e9f50c5b5aea85b56e80b198
Author: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Date:   Thu Oct 10 20:06:17 2024 +0200

    thermal: of: Simplify thermal_of_should_bind with scoped for each OF child

    Use scoped for_each_child_of_node_scoped() when iterating over device
    nodes to make code a bit simpler.

Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
    Link: https://patch.msgid.link/20241010-b4-cleanup-h-of-node-put-thermal-v4-1-bfbe29ad81f4@linaro.org


Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>

Signed-off-by: default avatarDavid Arcari <darcari@redhat.com>
parent 80b183e8
No related branches found
No related tags found
No related merge requests found
......@@ -301,7 +301,7 @@ static bool thermal_of_should_bind(struct thermal_zone_device *tz,
struct thermal_cooling_device *cdev,
struct cooling_spec *c)
{
struct device_node *tz_np, *cm_np, *child;
struct device_node *tz_np, *cm_np;
bool result = false;
tz_np = thermal_of_zone_get_by_name(tz);
......@@ -315,7 +315,7 @@ static bool thermal_of_should_bind(struct thermal_zone_device *tz,
goto out;
/* Look up the trip and the cdev in the cooling maps. */
for_each_child_of_node(cm_np, child) {
for_each_child_of_node_scoped(cm_np, child) {
struct device_node *tr_np;
int count, i;
......@@ -334,7 +334,6 @@ static bool thermal_of_should_bind(struct thermal_zone_device *tz,
break;
}
of_node_put(child);
break;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment