summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2012-01-24 12:44:34 +0100
committerFelipe Balbi <balbi@ti.com>2012-01-24 15:43:17 +0200
commitc09d6b51d78f5ad33417dbac9b479bd6709f9f25 (patch)
tree864f308145130a6967ab6d6508c033aff47330c7 /drivers/usb
parent24307caef4950e42e7875a901856ed8816c4679c (diff)
downloadop-kernel-dev-c09d6b51d78f5ad33417dbac9b479bd6709f9f25.zip
op-kernel-dev-c09d6b51d78f5ad33417dbac9b479bd6709f9f25.tar.gz
usb: dwc3: unmap the proper number of sg entries
num_sgs contains the number of sgs assigned by the gadget. num_mapped_sgs contains the number of mapped sgs which may differ from the gadget's values. For dma_unmap_sg() we have to provide the value which was returned by dma_map_sg(). Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/dwc3/gadget.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index a696bde..064b6e2 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -101,7 +101,7 @@ void dwc3_unmap_buffer_from_dma(struct dwc3_request *req)
if (req->request.num_mapped_sgs) {
req->request.dma = DMA_ADDR_INVALID;
dma_unmap_sg(dwc->dev, req->request.sg,
- req->request.num_sgs,
+ req->request.num_mapped_sgs,
req->direction ? DMA_TO_DEVICE
: DMA_FROM_DEVICE);
OpenPOWER on IntegriCloud