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 <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20260301142158.90319-2-krzysztof.kozlowski@oss.qualcomm.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
Krzysztof Kozlowski
2026-03-01 15:21:59 +01:00
committed by Vinod Koul
parent 3af11daeae
commit fe8a56f098

View File

@@ -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) {