/* Retrieves the descriptor ring associated with a device. */
int dma_get_device_descriptor_ring(DMA_Device_t device, DMA_DescriptorRing_t *ring)
/* Retrieves the descriptor ring associated with a device. */
int dma_get_device_descriptor_ring(DMA_Device_t device, DMA_DescriptorRing_t *ring)
{
	DMA_DeviceAttribute_t *devAttr;
	memset(ring, 0, sizeof(*ring));
	if (!IsDeviceValid(device)) {
		return -ENODEV;
	}
	devAttr = &DMA_gDeviceAttribute[device];
	*ring = devAttr->ring;
	return 0;
}