[PATCH 4/4] dmaengine: xgene-dma: Remove unneeded ERROR check before clk_disable_unprepare

Wan Jiabing wanjiabing at vivo.com
Mon May 16 01:41:39 PDT 2022


clk_disable_unprepare() already checks ERROR by using IS_ERR_OR_NULL.
Remove unneeded ERROR check for pdma->clk.

Signed-off-by: Wan Jiabing <wanjiabing at vivo.com>
---
 drivers/dma/xgene-dma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/xgene-dma.c b/drivers/dma/xgene-dma.c
index 3589b4ef50b8..7f0088b09714 100644
--- a/drivers/dma/xgene-dma.c
+++ b/drivers/dma/xgene-dma.c
@@ -1769,8 +1769,7 @@ static int xgene_dma_probe(struct platform_device *pdev)
 
 err_dma_mask:
 err_clk_enable:
-	if (!IS_ERR(pdma->clk))
-		clk_disable_unprepare(pdma->clk);
+	clk_disable_unprepare(pdma->clk);
 
 	return ret;
 }
@@ -1794,8 +1793,7 @@ static int xgene_dma_remove(struct platform_device *pdev)
 		xgene_dma_delete_chan_rings(chan);
 	}
 
-	if (!IS_ERR(pdma->clk))
-		clk_disable_unprepare(pdma->clk);
+	clk_disable_unprepare(pdma->clk);
 
 	return 0;
 }
-- 
2.36.1




More information about the linux-arm-kernel mailing list