/* This is the reverse of s3c_hsotg_map_dma(), called for the completion of a request to ensure the buffer is ready for access by the caller.  */
static void s3c_hsotg_unmap_dma(struct s3c_hsotg *hsotg, struct s3c_hsotg_ep *hs_ep, struct s3c_hsotg_req *hs_req)
/* This is the reverse of s3c_hsotg_map_dma(), called for the completion of a request to ensure the buffer is ready for access by the caller.  */
static void s3c_hsotg_unmap_dma(struct s3c_hsotg *hsotg, struct s3c_hsotg_ep *hs_ep, struct s3c_hsotg_req *hs_req)
{
	struct usb_request *req = &hs_req->req;
	enum dma_data_direction dir;
	dir = hs_ep->dir_in ? DMA_TO_DEVICE : DMA_FROM_DEVICE;
	if (hs_req->req.length == 0)
		return;
	if (hs_req->mapped) {
		dma_unmap_single(hsotg->dev, req->dma, req->length, dir);
		req->dma = DMA_ADDR_INVALID;
		hs_req->mapped = 0;
	} else {
		dma_sync_single(hsotg->dev, req->dma, req->length, dir);
	}
}