From 8dfa1bbc7d32debd84763259aa872f4022a23e7b Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Tue, 18 Aug 2020 16:47:48 +0300 Subject: [PATCH] dmaengine: axi-dmac: move clock enable earlier The clock may also be required to read registers from the IP core (if it is provided and the driver needs to control it). So, move it earlier in the probe. Signed-off-by: Alexandru Ardelean --- drivers/dma/dma-axi-dmac.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/dma/dma-axi-dmac.c b/drivers/dma/dma-axi-dmac.c index 217d65ea7d97e3..55b908409b9015 100644 --- a/drivers/dma/dma-axi-dmac.c +++ b/drivers/dma/dma-axi-dmac.c @@ -913,6 +913,10 @@ static int axi_dmac_probe(struct platform_device *pdev) if (IS_ERR(dmac->clk)) return PTR_ERR(dmac->clk); + ret = clk_prepare_enable(dmac->clk); + if (ret < 0) + return ret; + INIT_LIST_HEAD(&dmac->chan.active_descs); of_channels = of_get_child_by_name(pdev->dev.of_node, "adi,channels"); @@ -956,10 +960,6 @@ static int axi_dmac_probe(struct platform_device *pdev) dmac->chan.vchan.desc_free = axi_dmac_desc_free; vchan_init(&dmac->chan.vchan, dma_dev); - ret = clk_prepare_enable(dmac->clk); - if (ret < 0) - return ret; - version = axi_dmac_read(dmac, ADI_AXI_REG_VERSION); ret = axi_dmac_detect_caps(dmac, version);