aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoger Quadros <rogerq@ti.com>2012-08-07 09:26:32 -0400
committerFelipe Balbi <balbi@ti.com>2012-08-09 05:34:47 -0400
commit660fa8863d2623b733d7977a56e2990437abcbdb (patch)
treefc5e6e73ba57c066d63242a3fd365b2c3287c9fc
parenta04d46d02e0c511dabb3c0a29286811a00d12b10 (diff)
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>
-rw-r--r--drivers/usb/musb/musb_gadget.c34
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)
722 struct dma_controller *c; 722 struct dma_controller *c;
723 struct dma_channel *channel; 723 struct dma_channel *channel;
724 int use_dma = 0; 724 int use_dma = 0;
725 int transfer_size;
725 726
726 c = musb->dma_controller; 727 c = musb->dma_controller;
727 channel = musb_ep->dma; 728 channel = musb_ep->dma;
@@ -742,35 +743,30 @@ static void rxstate(struct musb *musb, struct musb_request *req)
742 csr | MUSB_RXCSR_DMAMODE); 743 csr | MUSB_RXCSR_DMAMODE);
743 musb_writew(epio, MUSB_RXCSR, csr); 744 musb_writew(epio, MUSB_RXCSR, csr);
744 745
746 transfer_size = min(request->length - request->actual,
747 channel->max_len);
748 musb_ep->dma->desired_mode = 1;
749
745 } else { 750 } else {
746 if (!musb_ep->hb_mult && 751 if (!musb_ep->hb_mult &&
747 musb_ep->hw_ep->rx_double_buffered) 752 musb_ep->hw_ep->rx_double_buffered)
748 csr |= MUSB_RXCSR_AUTOCLEAR; 753 csr |= MUSB_RXCSR_AUTOCLEAR;
749 csr |= MUSB_RXCSR_DMAENAB; 754 csr |= MUSB_RXCSR_DMAENAB;
750 musb_writew(epio, MUSB_RXCSR, csr); 755 musb_writew(epio, MUSB_RXCSR, csr);
751 }
752 756
753 if (request->actual < request->length) { 757 transfer_size = min(request->length - request->actual,
754 int transfer_size = 0;
755 if (use_mode_1) {
756 transfer_size = min(request->length - request->actual,
757 channel->max_len);
758 musb_ep->dma->desired_mode = 1;
759 } else {
760 transfer_size = min(request->length - request->actual,
761 (unsigned)fifo_count); 758 (unsigned)fifo_count);
762 musb_ep->dma->desired_mode = 0; 759 musb_ep->dma->desired_mode = 0;
763 }
764
765 use_dma = c->channel_program(
766 channel,
767 musb_ep->packet_sz,
768 channel->desired_mode,
769 request->dma
770 + request->actual,
771 transfer_size);
772 } 760 }
773 761
762 use_dma = c->channel_program(
763 channel,
764 musb_ep->packet_sz,
765 channel->desired_mode,
766 request->dma
767 + request->actual,
768 transfer_size);
769
774 if (use_dma) 770 if (use_dma)
775 return; 771 return;
776 } 772 }