]> git.karo-electronics.de Git - linux-beck.git/commitdiff
usb: dwc3: gadget: drop the useless dma_sync_single* calls
authorFelipe Balbi <balbi@ti.com>
Thu, 8 Sep 2011 15:16:21 +0000 (18:16 +0300)
committerFelipe Balbi <balbi@ti.com>
Fri, 9 Sep 2011 10:05:26 +0000 (13:05 +0300)
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>
drivers/usb/dwc3/gadget.c

index 6c64c7385314f2f36a2f011196b548a419b974cc..2ea2fc86390db1d877ba29e1b85eda863d97f685 100644 (file)
@@ -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);
        }
 }