diff options
author | Han Xu <han.xu@nxp.com> | 2017-10-27 13:44:34 -0500 |
---|---|---|
committer | Han Xu <han.xu@nxp.com> | 2017-11-08 17:14:43 -0600 |
commit | b1eeb1f09c5dd586205abcd7500cc368455be817 (patch) | |
tree | d15a614b27691570b490f9c01ce86ec16f768391 /drivers | |
parent | 9febf85fc20c1075d5f3d6b9d7707f3727f57bb6 (diff) |
MLK-16769-3: dma: mxs-dma: clean up the i.MX7D clock code
There is only one clock need to be handled after the clock code change
for i.MX7D. remove the redundant code.
Signed-off-by: Han Xu <han.xu@nxp.com>
(cherry picked from commit 8a05d3d333556fe85be5cf9c97af3b7a296eeb14)
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dma/mxs-dma.c | 40 |
1 files changed, 6 insertions, 34 deletions
diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c index 6c382e717418..ee770d9c0172 100644 --- a/drivers/dma/mxs-dma.c +++ b/drivers/dma/mxs-dma.c @@ -453,12 +453,6 @@ static int mxs_dma_alloc_chan_resources(struct dma_chan *chan) if (ret) goto err_clk; - if (mxs_dma->dev_id == IMX7D_DMA) { - ret = clk_prepare_enable(mxs_dma->clk_io); - if (ret) - goto err_clk_unprepare; - } - mxs_dma_reset_chan(chan); dma_async_tx_descriptor_init(&mxs_chan->desc, chan); @@ -469,7 +463,6 @@ static int mxs_dma_alloc_chan_resources(struct dma_chan *chan) return 0; -err_clk_unprepare: clk_disable_unprepare(mxs_dma->clk); err_clk: free_irq(mxs_chan->chan_irq, mxs_dma); @@ -492,9 +485,6 @@ static void mxs_dma_free_chan_resources(struct dma_chan *chan) dma_free_coherent(mxs_dma->dma_device.dev, CCW_BLOCK_SIZE, mxs_chan->ccw, mxs_chan->ccw_phys); - if (mxs_dma->dev_id == IMX7D_DMA) - clk_disable_unprepare(mxs_dma->clk_io); - clk_disable_unprepare(mxs_dma->clk); } @@ -725,15 +715,9 @@ static int mxs_dma_init(struct mxs_dma_engine *mxs_dma) if (ret) return ret; - if (mxs_dma->dev_id == IMX7D_DMA) { - ret = clk_prepare_enable(mxs_dma->clk_io); - if (ret) - goto err_clk_bch; - } - ret = stmp_reset_block(mxs_dma->base); if (ret) - goto err_clk_io; + goto err_clk; /* enable apbh burst */ if (dma_is_apbh(mxs_dma)) { @@ -747,11 +731,9 @@ static int mxs_dma_init(struct mxs_dma_engine *mxs_dma) writel(MXS_DMA_CHANNELS_MASK << MXS_DMA_CHANNELS, mxs_dma->base + HW_APBHX_CTRL1 + STMP_OFFSET_REG_SET); -err_clk_io: - if (mxs_dma->dev_id == IMX7D_DMA) - clk_disable_unprepare(mxs_dma->clk_io); -err_clk_bch: +err_clk: clk_disable_unprepare(mxs_dma->clk); + return ret; } @@ -839,19 +821,9 @@ static int __init mxs_dma_probe(struct platform_device *pdev) if (IS_ERR(mxs_dma->base)) return PTR_ERR(mxs_dma->base); - if (mxs_dma->dev_id == IMX7D_DMA) { - mxs_dma->clk = devm_clk_get(&pdev->dev, "dma_apbh_bch"); - if (IS_ERR(mxs_dma->clk)) - return PTR_ERR(mxs_dma->clk); - mxs_dma->clk_io = devm_clk_get(&pdev->dev, "dma_apbh_io"); - if (IS_ERR(mxs_dma->clk_io)) - return PTR_ERR(mxs_dma->clk_io); - - } else { - mxs_dma->clk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(mxs_dma->clk)) - return PTR_ERR(mxs_dma->clk); - } + mxs_dma->clk = devm_clk_get(&pdev->dev, NULL); + if (IS_ERR(mxs_dma->clk)) + return PTR_ERR(mxs_dma->clk); dma_cap_set(DMA_SLAVE, mxs_dma->dma_device.cap_mask); dma_cap_set(DMA_CYCLIC, mxs_dma->dma_device.cap_mask); |