udi_dma_free(3udi)


Free DMA resources

SYNOPSIS

#include <udi.h>

void udi_dma_free (

	udi_dma_handle_t dma_handle );
 

ARGUMENTS dma_handle is a DMA handle allocated by udi_dma_prepare or udi_dma_mem_alloc.

DESCRIPTION udi_dma_free frees a DMA handle and any associated resources allocated by udi_dma_prepare or udi_dma_mem_alloc.

If the dma_handle is associated with shared control structure memory allocated by udi_dma_mem_alloc, the allocated memory will be freed, as will the scatter/gather list.

If the dma_handle was mapped to a buffer with udi_dma_buf_map, it must be unmapped (using udi_dma_buf_unmap) before udi_dma_free is called.

If dma_handle is equal to UDI_NULL_DMA_HANDLE, explicitly or implicitly (zeroed by initial value or by using udi_memset), this function acts as a no-op. Otherwise, dma_handle must have been allocated by udi_dma_prepare or udi_dma_mem_alloc.

Note - udi_dma_free does not do a udi_dma_sync operation.

warnings The driver must make sure that its device is no longer accessing the buffer or control structure memory before it calls udi_dma_free.

REFERENCES udi_dma_prepare, udi_dma_buf_map, udi_dma_buf_unmap, udi_dma_mem_alloc


UDI Physical I/O Specification Contents