]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
dmaengine: pl330: remove dma_slave_config direction usage
authorVinod Koul <vkoul@kernel.org>
Thu, 25 Oct 2018 14:26:07 +0000 (15:26 +0100)
committerVinod Koul <vkoul@kernel.org>
Sat, 24 Nov 2018 14:52:21 +0000 (20:22 +0530)
dma_slave_config direction was marked as deprecated quite some
time back, remove the usage from this driver so that the field
can be removed

Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/pl330.c

index 88750a34e85987f352ef0e32ded6b22fb8f5115f..cff1b143fff5d279ab56b9bab37bfc68da5dae6b 100644 (file)
@@ -448,6 +448,7 @@ struct dma_pl330_chan {
        /* DMA-mapped view of the FIFO; may differ if an IOMMU is present */
        dma_addr_t fifo_dma;
        enum dma_data_direction dir;
+       struct dma_slave_config slave_config;
 
        /* for cyclic capability */
        bool cyclic;
@@ -542,6 +543,10 @@ struct _xfer_spec {
        struct dma_pl330_desc *desc;
 };
 
+static int pl330_config_write(struct dma_chan *chan,
+                       struct dma_slave_config *slave_config,
+                       enum dma_transfer_direction direction);
+
 static inline bool _queue_full(struct pl330_thread *thrd)
 {
        return thrd->req[0].desc != NULL && thrd->req[1].desc != NULL;
@@ -2220,20 +2225,21 @@ static int fixup_burst_len(int max_burst_len, int quirks)
                return max_burst_len;
 }
 
-static int pl330_config(struct dma_chan *chan,
-                       struct dma_slave_config *slave_config)
+static int pl330_config_write(struct dma_chan *chan,
+                       struct dma_slave_config *slave_config,
+                       enum dma_transfer_direction direction)
 {
        struct dma_pl330_chan *pch = to_pchan(chan);
 
        pl330_unprep_slave_fifo(pch);
-       if (slave_config->direction == DMA_MEM_TO_DEV) {
+       if (direction == DMA_MEM_TO_DEV) {
                if (slave_config->dst_addr)
                        pch->fifo_addr = slave_config->dst_addr;
                if (slave_config->dst_addr_width)
                        pch->burst_sz = __ffs(slave_config->dst_addr_width);
                pch->burst_len = fixup_burst_len(slave_config->dst_maxburst,
                        pch->dmac->quirks);
-       } else if (slave_config->direction == DMA_DEV_TO_MEM) {
+       } else if (direction == DMA_DEV_TO_MEM) {
                if (slave_config->src_addr)
                        pch->fifo_addr = slave_config->src_addr;
                if (slave_config->src_addr_width)
@@ -2245,6 +2251,16 @@ static int pl330_config(struct dma_chan *chan,
        return 0;
 }
 
+static int pl330_config(struct dma_chan *chan,
+                       struct dma_slave_config *slave_config)
+{
+       struct dma_pl330_chan *pch = to_pchan(chan);
+
+       memcpy(&pch->slave_config, slave_config, sizeof(*slave_config));
+
+       return 0;
+}
+
 static int pl330_terminate_all(struct dma_chan *chan)
 {
        struct dma_pl330_chan *pch = to_pchan(chan);
@@ -2661,6 +2677,8 @@ static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic(
                return NULL;
        }
 
+       pl330_config_write(chan, &pch->slave_config, direction);
+
        if (!pl330_prep_slave_fifo(pch, direction))
                return NULL;
 
@@ -2815,6 +2833,8 @@ pl330_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
        if (unlikely(!pch || !sgl || !sg_len))
                return NULL;
 
+       pl330_config_write(chan, &pch->slave_config, direction);
+
        if (!pl330_prep_slave_fifo(pch, direction))
                return NULL;