diff options
author | Sergei Shtylyov <sshtylyov@ru.mvista.com> | 2011-05-07 11:44:13 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2011-05-13 07:34:07 -0400 |
commit | c51e36dc11e44aa960744ec1c36fb2ab8d68b218 (patch) | |
tree | ee8aa49d128d99e31e21fc3124efad5219276b9b /drivers/usb/musb/musb_host.c | |
parent | 981430a1704123b569865997bdde4f1de1afca7e (diff) |
usb: musb: host: remove duplicate check in musb_ep_program()
musb_ep_program() contains obviously duplicate check for 'dma_channel' in its
IN/receive path -- removing it allows to save one level of indentation. While
at it, improve the comment style...
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb/musb_host.c')
-rw-r--r-- | drivers/usb/musb/musb_host.c | 49 |
1 files changed, 22 insertions, 27 deletions
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index 75aa01e0036d..7295e316bdfc 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c | |||
@@ -837,33 +837,28 @@ static void musb_ep_program(struct musb *musb, u8 epnum, | |||
837 | /* kick things off */ | 837 | /* kick things off */ |
838 | 838 | ||
839 | if ((is_cppi_enabled() || tusb_dma_omap()) && dma_channel) { | 839 | if ((is_cppi_enabled() || tusb_dma_omap()) && dma_channel) { |
840 | /* candidate for DMA */ | 840 | /* Candidate for DMA */ |
841 | if (dma_channel) { | 841 | dma_channel->actual_len = 0L; |
842 | dma_channel->actual_len = 0L; | 842 | qh->segsize = len; |
843 | qh->segsize = len; | 843 | |
844 | 844 | /* AUTOREQ is in a DMA register */ | |
845 | /* AUTOREQ is in a DMA register */ | 845 | musb_writew(hw_ep->regs, MUSB_RXCSR, csr); |
846 | musb_writew(hw_ep->regs, MUSB_RXCSR, csr); | 846 | csr = musb_readw(hw_ep->regs, MUSB_RXCSR); |
847 | csr = musb_readw(hw_ep->regs, | 847 | |
848 | MUSB_RXCSR); | 848 | /* |
849 | 849 | * Unless caller treats short RX transfers as | |
850 | /* unless caller treats short rx transfers as | 850 | * errors, we dare not queue multiple transfers. |
851 | * errors, we dare not queue multiple transfers. | 851 | */ |
852 | */ | 852 | dma_ok = dma_controller->channel_program(dma_channel, |
853 | dma_ok = dma_controller->channel_program( | 853 | packet_sz, !(urb->transfer_flags & |
854 | dma_channel, packet_sz, | 854 | URB_SHORT_NOT_OK), |
855 | !(urb->transfer_flags | 855 | urb->transfer_dma + offset, |
856 | & URB_SHORT_NOT_OK), | 856 | qh->segsize); |
857 | urb->transfer_dma + offset, | 857 | if (!dma_ok) { |
858 | qh->segsize); | 858 | dma_controller->channel_release(dma_channel); |
859 | if (!dma_ok) { | 859 | hw_ep->rx_channel = dma_channel = NULL; |
860 | dma_controller->channel_release( | 860 | } else |
861 | dma_channel); | 861 | csr |= MUSB_RXCSR_DMAENAB; |
862 | hw_ep->rx_channel = NULL; | ||
863 | dma_channel = NULL; | ||
864 | } else | ||
865 | csr |= MUSB_RXCSR_DMAENAB; | ||
866 | } | ||
867 | } | 862 | } |
868 | 863 | ||
869 | csr |= MUSB_RXCSR_H_REQPKT; | 864 | csr |= MUSB_RXCSR_H_REQPKT; |