diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2012-07-09 02:10:28 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-07-09 12:48:26 -0400 |
commit | 2f0de9d844d6c08a8e9059ed0b8d3d5ab6b7911b (patch) | |
tree | 53b4f26d4a38eeb300140dc3209159df4ba655e9 /drivers/usb/renesas_usbhs/fifo.c | |
parent | 277bd8746bb8d23c00ff8343e58df783544e961e (diff) |
usb: renesas_usbhs: use dmaengine helper functions
This patch used dmaengine helper functions instead of using hand setting.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/renesas_usbhs/fifo.c')
-rw-r--r-- | drivers/usb/renesas_usbhs/fifo.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c index 6ec7f838d7fa..d5272d4714ce 100644 --- a/drivers/usb/renesas_usbhs/fifo.c +++ b/drivers/usb/renesas_usbhs/fifo.c | |||
@@ -771,22 +771,15 @@ static void xfer_work(struct work_struct *work) | |||
771 | struct usbhs_pipe *pipe = pkt->pipe; | 771 | struct usbhs_pipe *pipe = pkt->pipe; |
772 | struct usbhs_fifo *fifo = usbhs_pipe_to_fifo(pipe); | 772 | struct usbhs_fifo *fifo = usbhs_pipe_to_fifo(pipe); |
773 | struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe); | 773 | struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe); |
774 | struct scatterlist sg; | ||
775 | struct dma_async_tx_descriptor *desc; | 774 | struct dma_async_tx_descriptor *desc; |
776 | struct dma_chan *chan = usbhsf_dma_chan_get(fifo, pkt); | 775 | struct dma_chan *chan = usbhsf_dma_chan_get(fifo, pkt); |
777 | struct device *dev = usbhs_priv_to_dev(priv); | 776 | struct device *dev = usbhs_priv_to_dev(priv); |
778 | enum dma_transfer_direction dir; | 777 | enum dma_transfer_direction dir; |
779 | dma_cookie_t cookie; | ||
780 | 778 | ||
781 | dir = usbhs_pipe_is_dir_in(pipe) ? DMA_DEV_TO_MEM : DMA_MEM_TO_DEV; | 779 | dir = usbhs_pipe_is_dir_in(pipe) ? DMA_DEV_TO_MEM : DMA_MEM_TO_DEV; |
782 | 780 | ||
783 | sg_init_table(&sg, 1); | 781 | desc = dmaengine_prep_slave_single(chan, pkt->dma + pkt->actual, |
784 | sg_set_page(&sg, virt_to_page(pkt->dma), | 782 | pkt->trans, dir, |
785 | pkt->length, offset_in_page(pkt->dma)); | ||
786 | sg_dma_address(&sg) = pkt->dma + pkt->actual; | ||
787 | sg_dma_len(&sg) = pkt->trans; | ||
788 | |||
789 | desc = dmaengine_prep_slave_sg(chan, &sg, 1, dir, | ||
790 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); | 783 | DMA_PREP_INTERRUPT | DMA_CTRL_ACK); |
791 | if (!desc) | 784 | if (!desc) |
792 | return; | 785 | return; |
@@ -794,8 +787,7 @@ static void xfer_work(struct work_struct *work) | |||
794 | desc->callback = usbhsf_dma_complete; | 787 | desc->callback = usbhsf_dma_complete; |
795 | desc->callback_param = pipe; | 788 | desc->callback_param = pipe; |
796 | 789 | ||
797 | cookie = desc->tx_submit(desc); | 790 | if (dmaengine_submit(desc) < 0) { |
798 | if (cookie < 0) { | ||
799 | dev_err(dev, "Failed to submit dma descriptor\n"); | 791 | dev_err(dev, "Failed to submit dma descriptor\n"); |
800 | return; | 792 | return; |
801 | } | 793 | } |