dmaengine: jz4740: Split device_control
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Mon, 17 Nov 2014 13:42:11 +0000 (14:42 +0100)
committerVinod Koul <vinod.koul@intel.com>
Mon, 22 Dec 2014 06:58:58 +0000 (12:28 +0530)
Split the device_control callback of the JZ4740 DMA driver to make use of the
newly introduced callbacks, that will eventually be used to retrieve slave
capabilities.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/dma-jz4740.c

index bdeafeefa5f61b994341348cc6c438b7698ed035..4527a3ebeac446f58a4c3b3b8722d6caf16b1b63 100644 (file)
@@ -210,7 +210,7 @@ static enum jz4740_dma_transfer_size jz4740_dma_maxburst(u32 maxburst)
 }
 
 static int jz4740_dma_slave_config(struct dma_chan *c,
-       const struct dma_slave_config *config)
+                                  struct dma_slave_config *config)
 {
        struct jz4740_dmaengine_chan *chan = to_jz4740_dma_chan(c);
        struct jz4740_dma_dev *dmadev = jz4740_dma_chan_get_dev(chan);
@@ -290,21 +290,6 @@ static int jz4740_dma_terminate_all(struct dma_chan *c)
        return 0;
 }
 
-static int jz4740_dma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
-       unsigned long arg)
-{
-       struct dma_slave_config *config = (struct dma_slave_config *)arg;
-
-       switch (cmd) {
-       case DMA_SLAVE_CONFIG:
-               return jz4740_dma_slave_config(chan, config);
-       case DMA_TERMINATE_ALL:
-               return jz4740_dma_terminate_all(chan);
-       default:
-               return -ENOSYS;
-       }
-}
-
 static int jz4740_dma_start_transfer(struct jz4740_dmaengine_chan *chan)
 {
        struct jz4740_dma_dev *dmadev = jz4740_dma_chan_get_dev(chan);
@@ -561,7 +546,8 @@ static int jz4740_dma_probe(struct platform_device *pdev)
        dd->device_issue_pending = jz4740_dma_issue_pending;
        dd->device_prep_slave_sg = jz4740_dma_prep_slave_sg;
        dd->device_prep_dma_cyclic = jz4740_dma_prep_dma_cyclic;
-       dd->device_control = jz4740_dma_control;
+       dd->device_config = jz4740_dma_slave_config;
+       dd->device_terminate_all = jz4740_dma_terminate_all;
        dd->dev = &pdev->dev;
        INIT_LIST_HEAD(&dd->channels);