diff options
author | Roger Quadros <rogerq@ti.com> | 2012-08-07 16:26:32 +0300 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-08-09 12:34:47 +0300 |
commit | 660fa8863d2623b733d7977a56e2990437abcbdb (patch) | |
tree | fc5e6e73ba57c066d63242a3fd365b2c3287c9fc /drivers/usb | |
parent | a04d46d02e0c511dabb3c0a29286811a00d12b10 (diff) | |
download | blackbird-op-linux-660fa8863d2623b733d7977a56e2990437abcbdb.tar.gz blackbird-op-linux-660fa8863d2623b733d7977a56e2990437abcbdb.zip |
usb: musb: Remove redundant if statement
Remove unnecessary if condition. No change in logic.
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/musb/musb_gadget.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index 7fb060d91282..d0b87e7b4abf 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -722,6 +722,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) struct dma_controller *c; struct dma_channel *channel; int use_dma = 0; + int transfer_size; c = musb->dma_controller; channel = musb_ep->dma; @@ -742,35 +743,30 @@ static void rxstate(struct musb *musb, struct musb_request *req) csr | MUSB_RXCSR_DMAMODE); musb_writew(epio, MUSB_RXCSR, csr); + transfer_size = min(request->length - request->actual, + channel->max_len); + musb_ep->dma->desired_mode = 1; + } else { if (!musb_ep->hb_mult && musb_ep->hw_ep->rx_double_buffered) csr |= MUSB_RXCSR_AUTOCLEAR; csr |= MUSB_RXCSR_DMAENAB; musb_writew(epio, MUSB_RXCSR, csr); - } - if (request->actual < request->length) { - int transfer_size = 0; - if (use_mode_1) { - transfer_size = min(request->length - request->actual, - channel->max_len); - musb_ep->dma->desired_mode = 1; - } else { - transfer_size = min(request->length - request->actual, + transfer_size = min(request->length - request->actual, (unsigned)fifo_count); - musb_ep->dma->desired_mode = 0; - } - - use_dma = c->channel_program( - channel, - musb_ep->packet_sz, - channel->desired_mode, - request->dma - + request->actual, - transfer_size); + musb_ep->dma->desired_mode = 0; } + use_dma = c->channel_program( + channel, + musb_ep->packet_sz, + channel->desired_mode, + request->dma + + request->actual, + transfer_size); + if (use_dma) return; } |