提交 bb7ea284 编写于 作者: F Felipe Balbi

usb: dwc3: gadget: drop the useless dma_sync_single* calls

if req->dma isn't DMA_ADDR_INVALID it means gadget driver
mapped the request or allocated from coherent, so it's
unnecessary to do anything.
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 771f184e
......@@ -71,11 +71,6 @@ void dwc3_map_buffer_to_dma(struct dwc3_request *req)
req->request.length, req->direction
? DMA_TO_DEVICE : DMA_FROM_DEVICE);
req->mapped = true;
} else {
dma_sync_single_for_device(dwc->dev, req->request.dma,
req->request.length, req->direction
? DMA_TO_DEVICE : DMA_FROM_DEVICE);
req->mapped = false;
}
}
......@@ -94,10 +89,6 @@ void dwc3_unmap_buffer_from_dma(struct dwc3_request *req)
? DMA_TO_DEVICE : DMA_FROM_DEVICE);
req->mapped = 0;
req->request.dma = DMA_ADDR_INVALID;
} else {
dma_sync_single_for_cpu(dwc->dev, req->request.dma,
req->request.length, req->direction
? DMA_TO_DEVICE : DMA_FROM_DEVICE);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册