dmaengine: xilinx: Simplify with scoped for each OF child loop
Subsystems (2)
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.
Signed-off-by Krzysztof Kozlowski <[email protected]>
--- drivers/dma/xilinx/xilinx_dma.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/dma/xilinx/xilinx_dma.c +3 -5
@@ -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
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