Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 364590
b: refs/heads/master
c: 37730ec
h: refs/heads/master
v: v3
  • Loading branch information
Felipe Balbi committed Mar 18, 2013
1 parent 4075ee8 commit 03a1d95
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cc5060366b3c8cc20f0f4020a15fa5d39f4dc936
refs/heads/master: 37730eccf214ec343b7b0e6cce31400f56ca09ff
15 changes: 9 additions & 6 deletions trunk/drivers/usb/musb/musb_gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,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;
unsigned int transfer_size;

c = musb->dma_controller;
channel = musb_ep->dma;
Expand Down Expand Up @@ -669,10 +669,11 @@ 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,
transfer_size = min_t(unsigned int,
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)
Expand Down Expand Up @@ -702,7 +703,7 @@ static void rxstate(struct musb *musb, struct musb_request *req)

struct dma_controller *c;
struct dma_channel *channel;
int transfer_size = 0;
unsigned int transfer_size = 0;

c = musb->dma_controller;
channel = musb_ep->dma;
Expand All @@ -711,11 +712,13 @@ static void rxstate(struct musb *musb, struct musb_request *req)
if (fifo_count < musb_ep->packet_sz)
transfer_size = fifo_count;
else if (request->short_not_ok)
transfer_size = min(request->length -
transfer_size = min_t(unsigned int,
request->length -
request->actual,
channel->max_len);
else
transfer_size = min(request->length -
transfer_size = min_t(unsigned int,
request->length -
request->actual,
(unsigned)fifo_count);

Expand Down

0 comments on commit 03a1d95

Please sign in to comment.