[PATCH net-next] net: ethernet: dwmac: remove redundant null check before clk_disable_unprepare()

Zhang Changzhong zhangchangzhong at huawei.com
Mon Sep 7 08:46:54 EDT 2020


Because clk_prepare_enable() and clk_disable_unprepare() already checked
NULL clock parameter, so the additional checks are unnecessary, just
remove them.

Reported-by: Hulk Robot <hulkci at huawei.com>
Signed-off-by: Zhang Changzhong <zhangchangzhong at huawei.com>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
index 3c5df5e..efef547 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
@@ -129,8 +129,7 @@ static void imx_dwmac_exit(struct platform_device *pdev, void *priv)
 {
 	struct imx_priv_data *dwmac = priv;
 
-	if (dwmac->clk_tx)
-		clk_disable_unprepare(dwmac->clk_tx);
+	clk_disable_unprepare(dwmac->clk_tx);
 	clk_disable_unprepare(dwmac->clk_mem);
 }
 
-- 
2.9.5




More information about the linux-arm-kernel mailing list