/* Move a descriptor, including any children, to the free list.  */
static void dwc_desc_put(struct dw_dma_chan *dwc, struct dw_desc *desc)
/* Move a descriptor, including any children, to the free list.  */
static void dwc_desc_put(struct dw_dma_chan *dwc, struct dw_desc *desc)
{
	if (desc) {
		struct dw_desc *child;
		dwc_sync_desc_for_cpu(dwc, desc);
		spin_lock_bh(&dwc->lock);
		list_for_each_entry(child, &desc->tx_list, desc_node)
			dev_vdbg(chan2dev(&dwc->chan),
					"moving child desc %p to freelist\n",
					child);
		list_splice_init(&desc->tx_list, &dwc->free_list);
		dev_vdbg(chan2dev(&dwc->chan), "moving desc %p to freelist\n", desc);
		list_add(&desc->desc_node, &dwc->free_list);
		spin_unlock_bh(&dwc->lock);
	}
}