diff options
Diffstat (limited to 'drivers/usb/gadget/at91_udc.c')
-rw-r--r-- | drivers/usb/gadget/at91_udc.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c index fd15ced899d8..9b913afb2e6d 100644 --- a/drivers/usb/gadget/at91_udc.c +++ b/drivers/usb/gadget/at91_udc.c | |||
@@ -389,6 +389,7 @@ static int write_fifo(struct at91_ep *ep, struct at91_request *req) | |||
389 | u32 csr = __raw_readl(creg); | 389 | u32 csr = __raw_readl(creg); |
390 | u8 __iomem *dreg = ep->creg + (AT91_UDP_FDR(0) - AT91_UDP_CSR(0)); | 390 | u8 __iomem *dreg = ep->creg + (AT91_UDP_FDR(0) - AT91_UDP_CSR(0)); |
391 | unsigned total, count, is_last; | 391 | unsigned total, count, is_last; |
392 | u8 *buf; | ||
392 | 393 | ||
393 | /* | 394 | /* |
394 | * TODO: allow for writing two packets to the fifo ... that'll | 395 | * TODO: allow for writing two packets to the fifo ... that'll |
@@ -413,6 +414,8 @@ static int write_fifo(struct at91_ep *ep, struct at91_request *req) | |||
413 | return 0; | 414 | return 0; |
414 | } | 415 | } |
415 | 416 | ||
417 | buf = req->req.buf + req->req.actual; | ||
418 | prefetch(buf); | ||
416 | total = req->req.length - req->req.actual; | 419 | total = req->req.length - req->req.actual; |
417 | if (ep->ep.maxpacket < total) { | 420 | if (ep->ep.maxpacket < total) { |
418 | count = ep->ep.maxpacket; | 421 | count = ep->ep.maxpacket; |
@@ -435,7 +438,7 @@ static int write_fifo(struct at91_ep *ep, struct at91_request *req) | |||
435 | * recover when the actual bytecount matters (e.g. for USB Test | 438 | * recover when the actual bytecount matters (e.g. for USB Test |
436 | * and Measurement Class devices). | 439 | * and Measurement Class devices). |
437 | */ | 440 | */ |
438 | __raw_writesb(dreg, req->req.buf + req->req.actual, count); | 441 | __raw_writesb(dreg, buf, count); |
439 | csr &= ~SET_FX; | 442 | csr &= ~SET_FX; |
440 | csr |= CLR_FX | AT91_UDP_TXPKTRDY; | 443 | csr |= CLR_FX | AT91_UDP_TXPKTRDY; |
441 | __raw_writel(csr, creg); | 444 | __raw_writel(csr, creg); |
@@ -457,7 +460,7 @@ static void nuke(struct at91_ep *ep, int status) | |||
457 | if (list_empty(&ep->queue)) | 460 | if (list_empty(&ep->queue)) |
458 | return; | 461 | return; |
459 | 462 | ||
460 | VDBG("%s %s\n", __FUNCTION__, ep->ep.name); | 463 | VDBG("%s %s\n", __func__, ep->ep.name); |
461 | while (!list_empty(&ep->queue)) { | 464 | while (!list_empty(&ep->queue)) { |
462 | req = list_entry(ep->queue.next, struct at91_request, queue); | 465 | req = list_entry(ep->queue.next, struct at91_request, queue); |
463 | done(ep, req, status); | 466 | done(ep, req, status); |
@@ -792,7 +795,7 @@ static int at91_wakeup(struct usb_gadget *gadget) | |||
792 | int status = -EINVAL; | 795 | int status = -EINVAL; |
793 | unsigned long flags; | 796 | unsigned long flags; |
794 | 797 | ||
795 | DBG("%s\n", __FUNCTION__ ); | 798 | DBG("%s\n", __func__ ); |
796 | local_irq_save(flags); | 799 | local_irq_save(flags); |
797 | 800 | ||
798 | if (!udc->clocked || !udc->suspended) | 801 | if (!udc->clocked || !udc->suspended) |