/* Code accessing dma_async_is_complete() in a tight loop may give problems. If slaves are relying on interrupts to signal completion this function must not be called with interrupts disabled.  */
static enum dma_status pl08x_dma_tx_status(struct dma_chan *chan, dma_cookie_t cookie, struct dma_tx_state *txstate)
/* Code accessing dma_async_is_complete() in a tight loop may give problems. If slaves are relying on interrupts to signal completion this function must not be called with interrupts disabled.  */
static enum dma_status pl08x_dma_tx_status(struct dma_chan *chan, dma_cookie_t cookie, struct dma_tx_state *txstate)
{
	struct pl08x_dma_chan *plchan = to_pl08x_chan(chan);
	enum dma_status ret;
	ret = dma_cookie_status(chan, cookie, txstate);
	if (ret == DMA_SUCCESS)
		return ret;
	dma_set_residue(txstate, pl08x_getbytes_chan(plchan));
	if (plchan->state == PL08X_CHAN_PAUSED)
		return DMA_PAUSED;
	return DMA_IN_PROGRESS;
}