Skip to contentSkip to conversation

dmaengine: xilinx: Simplify with scoped for each OF child loop

PATCH RESEND Applied Krzysztof Kozlowski 2 participants 2 messages Mar 1 – Mar 9

Subsystems (2)

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 dmaengine: xilinx: Simplify with scoped for each OF child loop

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

---
 drivers/dma/xilinx/xilinx_dma.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/dma/xilinx/xilinx_dma.c +3 -5
index b53292e02448..02a05f215614 100644
@@ -3180,7 +3180,7 @@ static int xilinx_dma_probe(struct platform_device *pdev)
 					= axivdma_clk_init;
 	struct device_node *node = pdev->dev.of_node;
 	struct xilinx_dma_device *xdev;
-	struct device_node *child, *np = pdev->dev.of_node;
+	struct device_node *np = pdev->dev.of_node;
 	u32 num_frames, addr_width = XILINX_DMA_DFAULT_ADDRWIDTH, len_width;
 	int i, err;
 
@@ -3320,12 +3320,10 @@ static int xilinx_dma_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, xdev);
 
 	/* Initialize the channels */
-	for_each_child_of_node(node, child) {
+	for_each_child_of_node_scoped(node, child) {
 		err = xilinx_dma_child_probe(xdev, child);
-		if (err < 0) {
-			of_node_put(child);
+		if (err < 0)
 			goto error;
-		}
 	}
 
 	if (xdev->dma_config->dmatype == XDMA_TYPE_VDMA) {
Signature · 1 line
2.51.0
maintainer Applied
#1 lore raw
Quoted 4 lines · Krzysztof Kozlowski

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

Applied, thanks!

[1/1] dmaengine: xilinx: Simplify with scoped for each OF child loop

      commit: fe8a56f098fb87dd489666d6e9d6498be73a92e6

Best regards,

Signature · 1 line
~Vinod