diff options
Diffstat (limited to 'drivers/usb/gadget/net2280.c')
-rw-r--r-- | drivers/usb/gadget/net2280.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c index cdedd1336745..a5ccabc37f30 100644 --- a/drivers/usb/gadget/net2280.c +++ b/drivers/usb/gadget/net2280.c | |||
@@ -806,12 +806,8 @@ done (struct net2280_ep *ep, struct net2280_request *req, int status) | |||
806 | status = req->req.status; | 806 | status = req->req.status; |
807 | 807 | ||
808 | dev = ep->dev; | 808 | dev = ep->dev; |
809 | if (req->mapped) { | 809 | if (ep->dma) |
810 | pci_unmap_single (dev->pdev, req->req.dma, req->req.length, | 810 | usb_gadget_unmap_request(&dev->gadget, &req->req, ep->is_in); |
811 | ep->is_in ? PCI_DMA_TODEVICE : PCI_DMA_FROMDEVICE); | ||
812 | req->req.dma = DMA_ADDR_INVALID; | ||
813 | req->mapped = 0; | ||
814 | } | ||
815 | 811 | ||
816 | if (status && status != -ESHUTDOWN) | 812 | if (status && status != -ESHUTDOWN) |
817 | VDEBUG (dev, "complete %s req %p stat %d len %u/%u\n", | 813 | VDEBUG (dev, "complete %s req %p stat %d len %u/%u\n", |
@@ -857,10 +853,13 @@ net2280_queue (struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags) | |||
857 | return -EOPNOTSUPP; | 853 | return -EOPNOTSUPP; |
858 | 854 | ||
859 | /* set up dma mapping in case the caller didn't */ | 855 | /* set up dma mapping in case the caller didn't */ |
860 | if (ep->dma && _req->dma == DMA_ADDR_INVALID) { | 856 | if (ep->dma) { |
861 | _req->dma = pci_map_single (dev->pdev, _req->buf, _req->length, | 857 | int ret; |
862 | ep->is_in ? PCI_DMA_TODEVICE : PCI_DMA_FROMDEVICE); | 858 | |
863 | req->mapped = 1; | 859 | ret = usb_gadget_map_request(&dev->gadget, _req, |
860 | ep->is_in); | ||
861 | if (ret) | ||
862 | return ret; | ||
864 | } | 863 | } |
865 | 864 | ||
866 | #if 0 | 865 | #if 0 |