[PATCH] usb: gadget: fsl_udc_core: remove mapped flag

Chen Peter-B29397 B29397 at freescale.com
Wed Sep 5 12:17:05 EST 2012


 
> @@ -195,14 +195,13 @@ static void done(struct fsl_ep *ep, struct fsl_req
> *req, int status)
>  		dma_pool_free(udc->td_pool, curr_td, curr_td->td_dma);
>  	}
> 
> -	if (req->mapped) {
> +	if (req->req.dma != DMA_ADDR_INVALID) {
>  		dma_unmap_single(ep->udc->gadget.dev.parent,
>  			req->req.dma, req->req.length,
>  			ep_is_in(ep)
>  				? DMA_TO_DEVICE
>  				: DMA_FROM_DEVICE);
>  		req->req.dma = DMA_ADDR_INVALID;
> -		req->mapped = 0;
>  	} else
>  		dma_sync_single_for_cpu(ep->udc->gadget.dev.parent,
If the class driver has already mapped this address, the req->req.dma is not
DMA_ADDR_INVALID either, in this case, the dma_sync_single_for_cpu is enough.


Peter




More information about the Linuxppc-dev mailing list