提交 6440093f 编写于 作者: F Felipe Balbi

usb: gadget: goku: use generic map/unmap routines

those routines have everything we need to map/unmap
USB requests and it's better to use them.
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 ae4d7933
...@@ -311,12 +311,9 @@ done(struct goku_ep *ep, struct goku_request *req, int status) ...@@ -311,12 +311,9 @@ done(struct goku_ep *ep, struct goku_request *req, int status)
status = req->req.status; status = req->req.status;
dev = ep->dev; dev = ep->dev;
if (req->mapped) {
pci_unmap_single(dev->pdev, req->req.dma, req->req.length, if (ep->dma)
ep->is_in ? PCI_DMA_TODEVICE : PCI_DMA_FROMDEVICE); usb_gadget_unmap_request(&dev->gadget, &req->req, ep->is_in);
req->req.dma = DMA_ADDR_INVALID;
req->mapped = 0;
}
#ifndef USB_TRACE #ifndef USB_TRACE
if (status && status != -ESHUTDOWN) if (status && status != -ESHUTDOWN)
...@@ -737,10 +734,11 @@ goku_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags) ...@@ -737,10 +734,11 @@ goku_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags)
return -EBUSY; return -EBUSY;
/* set up dma mapping in case the caller didn't */ /* set up dma mapping in case the caller didn't */
if (ep->dma && _req->dma == DMA_ADDR_INVALID) { if (ep->dma) {
_req->dma = pci_map_single(dev->pdev, _req->buf, _req->length, status = usb_gadget_map_request(&dev->gadget, &req->req,
ep->is_in ? PCI_DMA_TODEVICE : PCI_DMA_FROMDEVICE); ep->is_in);
req->mapped = 1; if (status)
return status;
} }
#ifdef USB_TRACE #ifdef USB_TRACE
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册