summaryrefslogtreecommitdiffstats
path: root/drivers/soc
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2024-09-02 10:22:20 +0000
committerArnd Bergmann <arnd@arndb.de>2024-09-02 10:22:20 +0000
commite99769bf7adfdbaab98b5f79f2ae7cedbca2103b (patch)
treed6245b94199c534d0f804bfb2ad9e53f441ecb57 /drivers/soc
parentcdcf6263145bb93c6d42fcec9669f7dc3fe4a82c (diff)
parent4d57a840560c3ff04fed07a06b3aec7cbac4bff0 (diff)
downloadlinux-e99769bf7adfdbaab98b5f79f2ae7cedbca2103b.tar.gz
linux-e99769bf7adfdbaab98b5f79f2ae7cedbca2103b.tar.bz2
linux-e99769bf7adfdbaab98b5f79f2ae7cedbca2103b.zip
Merge tag 'tegra-for-6.12-soc' of https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/drivers
soc/tegra: Changes for v6.12-rc1 This is a single patch that simplifies code a little by employing the new scoped OF helpers. * tag 'tegra-for-6.12-soc' of https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: soc/tegra: pmc: Simplify with scoped for each OF child loop Link: https://lore.kernel.org/r/20240830141004.3195210-1-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/soc')
-rw-r--r--drivers/soc/tegra/pmc.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
index 6c37d6eb8b49..a08c377933c5 100644
--- a/drivers/soc/tegra/pmc.c
+++ b/drivers/soc/tegra/pmc.c
@@ -1438,7 +1438,7 @@ static int tegra_powergate_init(struct tegra_pmc *pmc,
struct device_node *parent)
{
struct of_phandle_args child_args, parent_args;
- struct device_node *np, *child;
+ struct device_node *np;
int err = 0;
/*
@@ -1457,12 +1457,10 @@ static int tegra_powergate_init(struct tegra_pmc *pmc,
if (!np)
return 0;
- for_each_child_of_node(np, child) {
+ for_each_child_of_node_scoped(np, child) {
err = tegra_powergate_add(pmc, child);
- if (err < 0) {
- of_node_put(child);
+ if (err < 0)
break;
- }
if (of_parse_phandle_with_args(child, "power-domains",
"#power-domain-cells",
@@ -1474,10 +1472,8 @@ static int tegra_powergate_init(struct tegra_pmc *pmc,
err = of_genpd_add_subdomain(&parent_args, &child_args);
of_node_put(parent_args.np);
- if (err) {
- of_node_put(child);
+ if (err)
break;
- }
}
of_node_put(np);