Commit 0324f25f authored by Felipe Balbi's avatar Felipe Balbi

usb: gadget: fusb300: switch over to usb_gadget_map/unmap_request()

we have generic implementations for a reason,
let's use them
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 5f6da778
...@@ -938,25 +938,22 @@ static void fusb300_wait_idma_finished(struct fusb300_ep *ep) ...@@ -938,25 +938,22 @@ static void fusb300_wait_idma_finished(struct fusb300_ep *ep)
static void fusb300_set_idma(struct fusb300_ep *ep, static void fusb300_set_idma(struct fusb300_ep *ep,
struct fusb300_request *req) struct fusb300_request *req)
{ {
dma_addr_t d; int ret;
d = dma_map_single(NULL, req->req.buf, req->req.length, DMA_TO_DEVICE); ret = usb_gadget_map_request(&ep->fusb300->gadget,
&req->req, DMA_TO_DEVICE);
if (dma_mapping_error(NULL, d)) { if (ret)
printk(KERN_DEBUG "dma_mapping_error\n");
return; return;
}
dma_sync_single_for_device(NULL, d, req->req.length, DMA_TO_DEVICE);
fusb300_enable_bit(ep->fusb300, FUSB300_OFFSET_IGER0, fusb300_enable_bit(ep->fusb300, FUSB300_OFFSET_IGER0,
FUSB300_IGER0_EEPn_PRD_INT(ep->epnum)); FUSB300_IGER0_EEPn_PRD_INT(ep->epnum));
fusb300_fill_idma_prdtbl(ep, d, req->req.length); fusb300_fill_idma_prdtbl(ep, req->req.dma, req->req.length);
/* check idma is done */ /* check idma is done */
fusb300_wait_idma_finished(ep); fusb300_wait_idma_finished(ep);
dma_unmap_single(NULL, d, req->req.length, DMA_TO_DEVICE); usb_gadget_unmap_request(&ep->fusb300->gadget,
&req->req, DMA_TO_DEVICE);
} }
static void in_ep_fifo_handler(struct fusb300_ep *ep) static void in_ep_fifo_handler(struct fusb300_ep *ep)
......
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