/* Releases the memory which was previously allocated for a descriptor ring.  */
void dma_free_descriptor_ring(DMA_DescriptorRing_t *ring)
/* Releases the memory which was previously allocated for a descriptor ring.  */
void dma_free_descriptor_ring(DMA_DescriptorRing_t *ring)
{
	if (ring->virtAddr != NULL) {
		dma_free_writecombine(NULL,
				      ring->bytesAllocated,
				      ring->virtAddr, ring->physAddr);
	}
	ring->bytesAllocated = 0;
	ring->descriptorsAllocated = 0;
	ring->virtAddr = NULL;
	ring->physAddr = 0;
}