Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Krzysztof Kozlowski and committed by
Rafael J. Wysocki
2ff772f4 4dc00afc

+2 -3
+2 -3
drivers/thermal/tegra/soctherm.c
··· 1651 1651 { 1652 1652 struct device *dev = &pdev->dev; 1653 1653 struct tegra_soctherm *ts = dev_get_drvdata(dev); 1654 - struct device_node *np_stc, *np_stcc; 1654 + struct device_node *np_stc; 1655 1655 const char *name; 1656 1656 int i; 1657 1657 ··· 1668 1668 return; 1669 1669 } 1670 1670 1671 - for_each_child_of_node(np_stc, np_stcc) { 1671 + for_each_child_of_node_scoped(np_stc, np_stcc) { 1672 1672 struct soctherm_throt_cfg *stc; 1673 1673 struct thermal_cooling_device *tcd; 1674 1674 int err; ··· 1683 1683 1684 1684 if (stc->init) { 1685 1685 dev_err(dev, "throttle-cfg: %s: redefined!\n", name); 1686 - of_node_put(np_stcc); 1687 1686 break; 1688 1687 } 1689 1688