Skip to content

Commit

Permalink
dmaengine: axi-dmac: move clock enable earlier
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
commodo committed Aug 19, 2020
1 parent 10204f1 commit 8dfa1bb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/dma/dma-axi-dmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 8dfa1bb

Please sign in to comment.