@@ -1651,7 +1651,7 @@ static void soctherm_init_hw_throt_cdev(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct tegra_soctherm *ts = dev_get_drvdata(dev);
- struct device_node *np_stc, *np_stcc;
+ struct device_node *np_stc;
const char *name;
int i;
@@ -1668,7 +1668,7 @@ static void soctherm_init_hw_throt_cdev(struct platform_device *pdev)
return;
}
- for_each_child_of_node(np_stc, np_stcc) {
+ for_each_child_of_node_scoped(np_stc, np_stcc) {
struct soctherm_throt_cfg *stc;
struct thermal_cooling_device *tcd;
int err;
@@ -1683,7 +1683,6 @@ static void soctherm_init_hw_throt_cdev(struct platform_device *pdev)
if (stc->init) {
dev_err(dev, "throttle-cfg: %s: redefined!\n", name);
- of_node_put(np_stcc);
break;
}