diff options
author | Nicolas Ferre <nicolas.ferre@atmel.com> | 2011-05-06 13:56:53 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2011-05-09 02:14:13 -0400 |
commit | e257e1563f28890f54b5f82861373bb4b32dd770 (patch) | |
tree | 74a53085d734b41ea233d6fccf8e424d9a405311 /drivers/dma | |
parent | 23b5e3ad68a3c26a6a36039ea907997664aedcab (diff) |
dmaengine: at_hdmac: use descriptor chaining help function
A little function helps to chain descriptors:
it is already used in cyclic dma operations, now use it in memcpy and slave_sg
preparation functions.
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/at_hdmac.c | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index 5968245e1e6a..2c6bc3aa3dd0 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c | |||
@@ -626,16 +626,7 @@ atc_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src, | |||
626 | 626 | ||
627 | desc->txd.cookie = 0; | 627 | desc->txd.cookie = 0; |
628 | 628 | ||
629 | if (!first) { | 629 | atc_desc_chain(&first, &prev, desc); |
630 | first = desc; | ||
631 | } else { | ||
632 | /* inform the HW lli about chaining */ | ||
633 | prev->lli.dscr = desc->txd.phys; | ||
634 | /* insert the link descriptor to the LD ring */ | ||
635 | list_add_tail(&desc->desc_node, | ||
636 | &first->tx_list); | ||
637 | } | ||
638 | prev = desc; | ||
639 | } | 630 | } |
640 | 631 | ||
641 | /* First descriptor of the chain embedds additional information */ | 632 | /* First descriptor of the chain embedds additional information */ |
@@ -726,16 +717,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, | |||
726 | | len >> mem_width; | 717 | | len >> mem_width; |
727 | desc->lli.ctrlb = ctrlb; | 718 | desc->lli.ctrlb = ctrlb; |
728 | 719 | ||
729 | if (!first) { | 720 | atc_desc_chain(&first, &prev, desc); |
730 | first = desc; | ||
731 | } else { | ||
732 | /* inform the HW lli about chaining */ | ||
733 | prev->lli.dscr = desc->txd.phys; | ||
734 | /* insert the link descriptor to the LD ring */ | ||
735 | list_add_tail(&desc->desc_node, | ||
736 | &first->tx_list); | ||
737 | } | ||
738 | prev = desc; | ||
739 | total_len += len; | 721 | total_len += len; |
740 | } | 722 | } |
741 | break; | 723 | break; |
@@ -769,16 +751,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, | |||
769 | | len >> reg_width; | 751 | | len >> reg_width; |
770 | desc->lli.ctrlb = ctrlb; | 752 | desc->lli.ctrlb = ctrlb; |
771 | 753 | ||
772 | if (!first) { | 754 | atc_desc_chain(&first, &prev, desc); |
773 | first = desc; | ||
774 | } else { | ||
775 | /* inform the HW lli about chaining */ | ||
776 | prev->lli.dscr = desc->txd.phys; | ||
777 | /* insert the link descriptor to the LD ring */ | ||
778 | list_add_tail(&desc->desc_node, | ||
779 | &first->tx_list); | ||
780 | } | ||
781 | prev = desc; | ||
782 | total_len += len; | 755 | total_len += len; |
783 | } | 756 | } |
784 | break; | 757 | break; |