dmaengine: axi-dmac: move active_descs list init after device-tree init
authorAlexandru Ardelean <alexandru.ardelean@analog.com>
Tue, 25 Aug 2020 15:19:46 +0000 (18:19 +0300)
committerVinod Koul <vkoul@kernel.org>
Tue, 25 Aug 2020 15:37:10 +0000 (21:07 +0530)
We want to enable the clock right after it is obtained. Then later we'll
want to read the core version via register-access (which requires the clock
to be enabled).

The initialization of the active_descs list can be postponed after reading
from registers (or reading the device-tree).

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20200825151950.57605-3-alexandru.ardelean@analog.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/dma-axi-dmac.c

index 088c79137398877f3278980e2213fc14485b51a3..90a99bdffa2bf2a7e364b0c99dec88001b1534a1 100644 (file)
@@ -850,8 +850,6 @@ static int axi_dmac_probe(struct platform_device *pdev)
        if (IS_ERR(dmac->clk))
                return PTR_ERR(dmac->clk);
 
-       INIT_LIST_HEAD(&dmac->chan.active_descs);
-
        of_channels = of_get_child_by_name(pdev->dev.of_node, "adi,channels");
        if (of_channels == NULL)
                return -ENODEV;
@@ -866,6 +864,8 @@ static int axi_dmac_probe(struct platform_device *pdev)
        }
        of_node_put(of_channels);
 
+       INIT_LIST_HEAD(&dmac->chan.active_descs);
+
        pdev->dev.dma_parms = &dmac->dma_parms;
        dma_set_max_seg_size(&pdev->dev, UINT_MAX);