From: Tudor Ambarus Date: Tue, 25 Oct 2022 09:02:51 +0000 (+0300) Subject: dmaengine: at_hdmac: Return dma_cookie_status()'s ret code when txstate is NULL X-Git-Tag: v6.6.7~3860^2~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=83c196152fc9a93c3d5a7cbf3229f42f87f232d8;p=platform%2Fkernel%2Flinux-starfive.git dmaengine: at_hdmac: Return dma_cookie_status()'s ret code when txstate is NULL txstate is an optional parameter used to get a struct with auxilary transfer status information. When not provided the call to device_tx_status() should return the status of the dma cookie. Return the status of dma cookie when the txstate optional parameter is not provided. Signed-off-by: Tudor Ambarus Acked-by: Nicolas Ferre Link: https://lore.kernel.org/r/20221025090306.297886-1-tudor.ambarus@microchip.com Link: https://lore.kernel.org/r/20221025090306.297886-18-tudor.ambarus@microchip.com Signed-off-by: Vinod Koul --- diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index f365ac4..10b6b04 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -1461,14 +1461,8 @@ atc_tx_status(struct dma_chan *chan, int bytes = 0; ret = dma_cookie_status(chan, cookie, txstate); - if (ret == DMA_COMPLETE) + if (ret == DMA_COMPLETE || !txstate) return ret; - /* - * There's no point calculating the residue if there's - * no txstate to store the value. - */ - if (!txstate) - return DMA_ERROR; spin_lock_irqsave(&atchan->lock, flags);