diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2015-03-16 10:53:57 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-03-26 23:02:48 +0100 |
commit | 4bb82458ec76edc6d2a91fd3b2d2daae44561443 (patch) | |
tree | d6a43899fe02a0b111b73951fa1954a0dc6391a6 /drivers/dma | |
parent | 90b9aacf912af38a177114ca232051c61be8b93e (diff) | |
download | linux-4bb82458ec76edc6d2a91fd3b2d2daae44561443.tar.bz2 |
dmaengine: hsu: remove redundant pieces of code
There are few places where the implemented pieces of code are not needed, i.e.:
- direction can't be wrong in hsu_dma_chan_start()
- desc->active set to 0 by kzalloc
- DMAEngine is NULL-aware when call ->device_alloc_chan_resources()
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/hsu/hsu.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/dma/hsu/hsu.c b/drivers/dma/hsu/hsu.c index 683ba9b62795..e649b62431e2 100644 --- a/drivers/dma/hsu/hsu.c +++ b/drivers/dma/hsu/hsu.c @@ -58,7 +58,7 @@ static void hsu_dma_chan_start(struct hsu_dma_chan *hsuc) { struct dma_slave_config *config = &hsuc->config; struct hsu_dma_desc *desc = hsuc->desc; - u32 bsr, mtsr; + u32 bsr = 0, mtsr = 0; /* to shut the compiler up */ u32 dcr = HSU_CH_DCR_CHSOE | HSU_CH_DCR_CHEI; unsigned int i, count; @@ -68,9 +68,6 @@ static void hsu_dma_chan_start(struct hsu_dma_chan *hsuc) } else if (hsuc->direction == DMA_DEV_TO_MEM) { bsr = config->src_maxburst; mtsr = config->src_addr_width; - } else { - /* Not supported direction */ - return; } hsu_chan_disable(hsuc); @@ -243,7 +240,7 @@ static struct dma_async_tx_descriptor *hsu_dma_prep_slave_sg( desc->nents = sg_len; desc->direction = direction; - desc->active = 0; + /* desc->active = 0 by kzalloc */ desc->status = DMA_IN_PROGRESS; return vchan_tx_prep(&hsuc->vchan, &desc->vdesc, flags); @@ -396,11 +393,6 @@ static int hsu_dma_terminate_all(struct dma_chan *chan) return 0; } -static int hsu_dma_alloc_chan_resources(struct dma_chan *chan) -{ - return 0; -} - static void hsu_dma_free_chan_resources(struct dma_chan *chan) { vchan_free_chan_resources(to_virt_chan(chan)); @@ -453,7 +445,6 @@ int hsu_dma_probe(struct hsu_dma_chip *chip) dma_cap_set(DMA_SLAVE, hsu->dma.cap_mask); dma_cap_set(DMA_PRIVATE, hsu->dma.cap_mask); - hsu->dma.device_alloc_chan_resources = hsu_dma_alloc_chan_resources; hsu->dma.device_free_chan_resources = hsu_dma_free_chan_resources; hsu->dma.device_prep_slave_sg = hsu_dma_prep_slave_sg; |