linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] cpuidle: psci: Simplify with scoped for each OF child loop
@ 2024-08-16 15:09 Krzysztof Kozlowski
  2024-08-16 15:09 ` [PATCH 2/4] cpuidle: riscv-sbi: Use scoped device node handling to simplify error paths Krzysztof Kozlowski
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Krzysztof Kozlowski @ 2024-08-16 15:09 UTC (permalink / raw)
  To: Ulf Hansson, Rafael J. Wysocki, Daniel Lezcano, Anup Patel,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-pm,
	linux-arm-kernel, linux-kernel, linux-riscv
  Cc: Krzysztof Kozlowski

Use scoped for_each_child_of_node_scoped() when iterating over device
nodes to make code a bit simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/cpuidle/cpuidle-psci-domain.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/cpuidle/cpuidle-psci-domain.c b/drivers/cpuidle/cpuidle-psci-domain.c
index ea28b73ef3fb..146f97068022 100644
--- a/drivers/cpuidle/cpuidle-psci-domain.c
+++ b/drivers/cpuidle/cpuidle-psci-domain.c
@@ -142,7 +142,6 @@ static const struct of_device_id psci_of_match[] = {
 static int psci_cpuidle_domain_probe(struct platform_device *pdev)
 {
 	struct device_node *np = pdev->dev.of_node;
-	struct device_node *node;
 	bool use_osi = psci_has_osi_support();
 	int ret = 0, pd_count = 0;
 
@@ -153,15 +152,13 @@ static int psci_cpuidle_domain_probe(struct platform_device *pdev)
 	 * Parse child nodes for the "#power-domain-cells" property and
 	 * initialize a genpd/genpd-of-provider pair when it's found.
 	 */
-	for_each_child_of_node(np, node) {
+	for_each_child_of_node_scoped(np, node) {
 		if (!of_property_present(node, "#power-domain-cells"))
 			continue;
 
 		ret = psci_pd_init(node, use_osi);
-		if (ret) {
-			of_node_put(node);
+		if (ret)
 			goto exit;
-		}
 
 		pd_count++;
 	}
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-08-21 11:48 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-16 15:09 [PATCH 1/4] cpuidle: psci: Simplify with scoped for each OF child loop Krzysztof Kozlowski
2024-08-16 15:09 ` [PATCH 2/4] cpuidle: riscv-sbi: Use scoped device node handling to simplify error paths Krzysztof Kozlowski
2024-08-19 16:13   ` Jonathan Cameron
2024-08-19 16:19     ` Jonathan Cameron
2024-08-20  9:36       ` Krzysztof Kozlowski
2024-08-21 11:48         ` Jonathan Cameron
2024-08-20  9:29     ` Krzysztof Kozlowski
2024-08-16 15:09 ` [PATCH 3/4] cpuidle: riscv-sbi: Simplify with scoped for each OF child loop Krzysztof Kozlowski
2024-08-19 16:24   ` Jonathan Cameron
2024-08-16 15:09 ` [PATCH 4/4] cpuidle: dt_idle_genpd: " Krzysztof Kozlowski
2024-08-19 16:26   ` Jonathan Cameron
2024-08-20  9:34   ` Ulf Hansson
2024-08-19 16:11 ` [PATCH 1/4] cpuidle: psci: " Jonathan Cameron
2024-08-20  9:33 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).