mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 1/3] bus: qcom-ebi2: Simplify with scoped for each OF child loop
@ 2026-01-05 14:36 Krzysztof Kozlowski
  2026-01-05 14:36 ` [PATCH v2 2/3] bus: stm32_firewall: " Krzysztof Kozlowski
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Krzysztof Kozlowski @ 2026-01-05 14:36 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Gatien Chevallier,
	Maxime Coquelin, Alexandre Torgue, linux-arm-msm, linux-kernel,
	linux-stm32, linux-arm-kernel
  Cc: Krzysztof Kozlowski, Konrad Dybcio

Use scoped for-each loop when iterating over device nodes to make code a
bit simpler.

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

---

Changes in v2:
1. Add Rb tag
---
 drivers/bus/qcom-ebi2.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/bus/qcom-ebi2.c b/drivers/bus/qcom-ebi2.c
index c1fef1b4bd89..be8166565e7c 100644
--- a/drivers/bus/qcom-ebi2.c
+++ b/drivers/bus/qcom-ebi2.c
@@ -292,7 +292,6 @@ static void qcom_ebi2_setup_chipselect(struct device_node *np,
 static int qcom_ebi2_probe(struct platform_device *pdev)
 {
 	struct device_node *np = pdev->dev.of_node;
-	struct device_node *child;
 	struct device *dev = &pdev->dev;
 	struct resource *res;
 	void __iomem *ebi2_base;
@@ -348,15 +347,13 @@ static int qcom_ebi2_probe(struct platform_device *pdev)
 	writel(val, ebi2_base);
 
 	/* Walk over the child nodes and see what chipselects we use */
-	for_each_available_child_of_node(np, child) {
+	for_each_available_child_of_node_scoped(np, child) {
 		u32 csindex;
 
 		/* Figure out the chipselect */
 		ret = of_property_read_u32(child, "reg", &csindex);
-		if (ret) {
-			of_node_put(child);
+		if (ret)
 			return ret;
-		}
 
 		if (csindex > 5) {
 			dev_err(dev,
-- 
2.51.0


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

end of thread, other threads:[~2026-03-10  9:04 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-05 14:36 [PATCH v2 1/3] bus: qcom-ebi2: Simplify with scoped for each OF child loop Krzysztof Kozlowski
2026-01-05 14:36 ` [PATCH v2 2/3] bus: stm32_firewall: " Krzysztof Kozlowski
2026-01-09 10:33   ` Gatien CHEVALLIER
2026-01-05 14:37 ` [PATCH v2 3/3] bus: stm32_firewall: Use scoped allocation to simplify cleanup Krzysztof Kozlowski
2026-01-09 10:37   ` Gatien CHEVALLIER
2026-01-09 11:55     ` Krzysztof Kozlowski
2026-01-09 12:34       ` Gatien CHEVALLIER
2026-01-09 15:20         ` Krzysztof Kozlowski
2026-03-01 14:12   ` Krzysztof Kozlowski
2026-03-02  8:15     ` Alexandre TORGUE
2026-03-10  9:04     ` Alexandre TORGUE
2026-01-05 14:38 ` [PATCH v2 1/3] bus: qcom-ebi2: Simplify with scoped for each OF child loop Krzysztof Kozlowski
2026-01-06 17:52 ` (subset) " Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®