Commit 660fa886 authored by Roger Quadros's avatar Roger Quadros Committed by Felipe Balbi

usb: musb: Remove redundant if statement

Remove unnecessary if condition. No change in logic.
Signed-off-by: default avatarRoger Quadros <rogerq@ti.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent a04d46d0
...@@ -722,6 +722,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) ...@@ -722,6 +722,7 @@ static void rxstate(struct musb *musb, struct musb_request *req)
struct dma_controller *c; struct dma_controller *c;
struct dma_channel *channel; struct dma_channel *channel;
int use_dma = 0; int use_dma = 0;
int transfer_size;
c = musb->dma_controller; c = musb->dma_controller;
channel = musb_ep->dma; channel = musb_ep->dma;
...@@ -742,21 +743,17 @@ static void rxstate(struct musb *musb, struct musb_request *req) ...@@ -742,21 +743,17 @@ static void rxstate(struct musb *musb, struct musb_request *req)
csr | MUSB_RXCSR_DMAMODE); csr | MUSB_RXCSR_DMAMODE);
musb_writew(epio, MUSB_RXCSR, csr); musb_writew(epio, MUSB_RXCSR, csr);
transfer_size = min(request->length - request->actual,
channel->max_len);
musb_ep->dma->desired_mode = 1;
} else { } else {
if (!musb_ep->hb_mult && if (!musb_ep->hb_mult &&
musb_ep->hw_ep->rx_double_buffered) musb_ep->hw_ep->rx_double_buffered)
csr |= MUSB_RXCSR_AUTOCLEAR; csr |= MUSB_RXCSR_AUTOCLEAR;
csr |= MUSB_RXCSR_DMAENAB; csr |= MUSB_RXCSR_DMAENAB;
musb_writew(epio, MUSB_RXCSR, csr); 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); (unsigned)fifo_count);
musb_ep->dma->desired_mode = 0; musb_ep->dma->desired_mode = 0;
...@@ -769,7 +766,6 @@ static void rxstate(struct musb *musb, struct musb_request *req) ...@@ -769,7 +766,6 @@ static void rxstate(struct musb *musb, struct musb_request *req)
request->dma request->dma
+ request->actual, + request->actual,
transfer_size); transfer_size);
}
if (use_dma) if (use_dma)
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment