diff options
author | Han Xu <han.xu@nxp.com> | 2017-10-27 13:44:34 -0500 |
---|---|---|
committer | Leonard Crestez <leonard.crestez@nxp.com> | 2018-08-24 12:41:33 +0300 |
commit | 768019194948420ea9fcba0c1cd0e4f510f59aa5 (patch) | |
tree | a6fe9944f91629f28ede49808e0da6b5a4180bcb /drivers/dma/mxs-dma.c | |
parent | 700a748c505c4f39f4db65c321a91b067c223adc (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>
Diffstat (limited to 'drivers/dma/mxs-dma.c')
-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); |