Skip to content

Commit 2ff772f

Browse files
krzkrafaeljw
authored andcommitted
thermal: tegra: Simplify with scoped for each OF child loop
Use scoped for_each_child_of_node_scoped() when iterating over device nodes to make code a bit simpler. Reviewed-by: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://patch.msgid.link/20241010-b4-cleanup-h-of-node-put-thermal-v4-5-bfbe29ad81f4@linaro.org Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 4dc00af commit 2ff772f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/thermal/tegra/soctherm.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1651,7 +1651,7 @@ static void soctherm_init_hw_throt_cdev(struct platform_device *pdev)
16511651
{
16521652
struct device *dev = &pdev->dev;
16531653
struct tegra_soctherm *ts = dev_get_drvdata(dev);
1654-
struct device_node *np_stc, *np_stcc;
1654+
struct device_node *np_stc;
16551655
const char *name;
16561656
int i;
16571657

@@ -1668,7 +1668,7 @@ static void soctherm_init_hw_throt_cdev(struct platform_device *pdev)
16681668
return;
16691669
}
16701670

1671-
for_each_child_of_node(np_stc, np_stcc) {
1671+
for_each_child_of_node_scoped(np_stc, np_stcc) {
16721672
struct soctherm_throt_cfg *stc;
16731673
struct thermal_cooling_device *tcd;
16741674
int err;
@@ -1683,7 +1683,6 @@ static void soctherm_init_hw_throt_cdev(struct platform_device *pdev)
16831683

16841684
if (stc->init) {
16851685
dev_err(dev, "throttle-cfg: %s: redefined!\n", name);
1686-
of_node_put(np_stcc);
16871686
break;
16881687
}
16891688

0 commit comments

Comments
 (0)