Skip to content

Commit

Permalink
usb: dwc3: gadget: drop the useless dma_sync_single* calls
Browse files Browse the repository at this point in the history
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: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Felipe Balbi committed Sep 9, 2011
1 parent 771f184 commit bb7ea28
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions drivers/usb/dwc3/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand All @@ -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);
}
}

Expand Down

0 comments on commit bb7ea28

Please sign in to comment.