summaryrefslogtreecommitdiffstats
path: root/drivers/pmdomain
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2024-05-29 11:20:20 +0200
committerUlf Hansson <ulf.hansson@linaro.org>2024-06-05 11:52:39 +0200
commit196e9f5bf2c566682f52fb6a25276794dded2fe9 (patch)
tree7ecae07a3f6213755762acf18d826ce3087bb8fa /drivers/pmdomain
parentpmdomain: core: Use genpd_is_irq_safe() helper (diff)
downloadlinux-196e9f5bf2c566682f52fb6a25276794dded2fe9.tar.xz
linux-196e9f5bf2c566682f52fb6a25276794dded2fe9.zip
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>
Diffstat (limited to 'drivers/pmdomain')
-rw-r--r--drivers/pmdomain/renesas/rmobile-sysc.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/pmdomain/renesas/rmobile-sysc.c b/drivers/pmdomain/renesas/rmobile-sysc.c
index 0b77f37787d5..5848e79aa438 100644
--- a/drivers/pmdomain/renesas/rmobile-sysc.c
+++ b/drivers/pmdomain/renesas/rmobile-sysc.c
@@ -268,9 +268,7 @@ static int __init rmobile_add_pm_domains(void __iomem *base,
struct device_node *parent,
struct generic_pm_domain *genpd_parent)
{
- struct device_node *np;
-
- for_each_child_of_node(parent, np) {
+ for_each_child_of_node_scoped(parent, np) {
struct rmobile_pm_domain *pd;
u32 idx = ~0;
@@ -279,10 +277,8 @@ static int __init rmobile_add_pm_domains(void __iomem *base,
}
pd = kzalloc(sizeof(*pd), GFP_KERNEL);
- if (!pd) {
- of_node_put(np);
+ if (!pd)
return -ENOMEM;
- }
pd->genpd.name = np->name;
pd->base = base;