提交 c51e36dc 编写于 作者: S Sergei Shtylyov 提交者: Felipe Balbi

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: NSergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 981430a1
...@@ -837,34 +837,29 @@ static void musb_ep_program(struct musb *musb, u8 epnum, ...@@ -837,34 +837,29 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
/* kick things off */ /* kick things off */
if ((is_cppi_enabled() || tusb_dma_omap()) && dma_channel) { if ((is_cppi_enabled() || tusb_dma_omap()) && dma_channel) {
/* candidate for DMA */ /* Candidate for DMA */
if (dma_channel) {
dma_channel->actual_len = 0L; dma_channel->actual_len = 0L;
qh->segsize = len; qh->segsize = len;
/* AUTOREQ is in a DMA register */ /* AUTOREQ is in a DMA register */
musb_writew(hw_ep->regs, MUSB_RXCSR, csr); musb_writew(hw_ep->regs, MUSB_RXCSR, csr);
csr = musb_readw(hw_ep->regs, csr = musb_readw(hw_ep->regs, MUSB_RXCSR);
MUSB_RXCSR);
/* unless caller treats short rx transfers as /*
* Unless caller treats short RX transfers as
* errors, we dare not queue multiple transfers. * errors, we dare not queue multiple transfers.
*/ */
dma_ok = dma_controller->channel_program( dma_ok = dma_controller->channel_program(dma_channel,
dma_channel, packet_sz, packet_sz, !(urb->transfer_flags &
!(urb->transfer_flags URB_SHORT_NOT_OK),
& URB_SHORT_NOT_OK),
urb->transfer_dma + offset, urb->transfer_dma + offset,
qh->segsize); qh->segsize);
if (!dma_ok) { if (!dma_ok) {
dma_controller->channel_release( dma_controller->channel_release(dma_channel);
dma_channel); hw_ep->rx_channel = dma_channel = NULL;
hw_ep->rx_channel = NULL;
dma_channel = NULL;
} else } else
csr |= MUSB_RXCSR_DMAENAB; csr |= MUSB_RXCSR_DMAENAB;
} }
}
csr |= MUSB_RXCSR_H_REQPKT; csr |= MUSB_RXCSR_H_REQPKT;
dev_dbg(musb->controller, "RXCSR%d := %04x\n", epnum, csr); dev_dbg(musb->controller, "RXCSR%d := %04x\n", epnum, csr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册