Skip to contentSkip to conversation

dmaengine: fsl-edma: Remove redundant check in fsl_edma_free_chan_resources()

PATCH Applied Zhen Ni 3 participants 3 messages Oct 14, 2025 – Feb 25

Subsystems (3)
lore
Share & tools
lore

Zhen Ni

author
#0 lore raw

PATCH 1/1 dmaengine: fsl-edma: Remove redundant check in fsl_edma_free_chan_resources()

clk_disable_unprepare() is safe to call with a NULL clk, the FSL_EDMA_DRV_HAS_CHCLK check is reduntante. Clean up redundant checks.

---
 drivers/dma/fsl-edma-common.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/dma/fsl-edma-common.c +1 -2
index 11655dcc4d6c..3007d5b7db55 100644
@@ -884,8 +884,7 @@ void fsl_edma_free_chan_resources(struct dma_chan *chan)
 	fsl_chan->is_sw = false;
 	fsl_chan->srcid = 0;
 	fsl_chan->is_remote = false;
-	if (fsl_edma_drvflags(fsl_chan) & FSL_EDMA_DRV_HAS_CHCLK)
-		clk_disable_unprepare(fsl_chan->clk);
+	clk_disable_unprepare(fsl_chan->clk);
 }
 
 void fsl_edma_cleanup_vchan(struct dma_device *dmadev)
Signature · 1 line
2.20.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Zhen Ni

clk_disable_unprepare() is safe to call with a NULL clk, the FSL_EDMA_DRV_HAS_CHCLK check is reduntante. Clean up redundant checks.

---

Quoted 20 lines
 drivers/dma/fsl-edma-common.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/dma/fsl-edma-common.c +1 -3
index 11655dcc4d6c..3007d5b7db55 100644
@@ -884,8 +884,7 @@ void fsl_edma_free_chan_resources(struct dma_chan *chan)
 	fsl_chan->is_sw = false;
 	fsl_chan->srcid = 0;
 	fsl_chan->is_remote = false;
-	if (fsl_edma_drvflags(fsl_chan) & FSL_EDMA_DRV_HAS_CHCLK)
-		clk_disable_unprepare(fsl_chan->clk);
+	clk_disable_unprepare(fsl_chan->clk);
 }
 
 void fsl_edma_cleanup_vchan(struct dma_device *dmadev)
--

2.20.1

maintainer Applied
#2 lore raw
In reply to Zhen Ni
Quoted 4 lines · Zhen Ni

clk_disable_unprepare() is safe to call with a NULL clk, the FSL_EDMA_DRV_HAS_CHCLK check is reduntante. Clean up redundant checks.

Applied, thanks!

[1/1] dmaengine: fsl-edma: Remove redundant check in fsl_edma_free_chan_resources()

      commit: 490c367b5fbcba6bb653077312c8ef477adf79b5

Best regards,

Signature · 1 line
~Vinod