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

pmdomain: renesas: rmobile-sysc: Use for_each_child_of_node_scoped()

Use the scoped variant of for_each_child_of_node() to simplify cleanup
handling.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/5e684d7b236904e5f79324a5e5357c2930f7402d.1716974368.git.geert+renesas@glider.be
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Geert Uytterhoeven and committed by
Ulf Hansson
196e9f5b 0ddaf2c1

+2 -6
+2 -6
drivers/pmdomain/renesas/rmobile-sysc.c
··· 268 268 struct device_node *parent, 269 269 struct generic_pm_domain *genpd_parent) 270 270 { 271 - struct device_node *np; 272 - 273 - for_each_child_of_node(parent, np) { 271 + for_each_child_of_node_scoped(parent, np) { 274 272 struct rmobile_pm_domain *pd; 275 273 u32 idx = ~0; 276 274 ··· 277 279 } 278 280 279 281 pd = kzalloc(sizeof(*pd), GFP_KERNEL); 280 - if (!pd) { 281 - of_node_put(np); 282 + if (!pd) 282 283 return -ENOMEM; 283 - } 284 284 285 285 pd->genpd.name = np->name; 286 286 pd->base = base;