]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: stmmac: dwmac-intel-plat: remove redundant null check before clk_disable_unprepare()
authorZhang Changzhong <zhangchangzhong@huawei.com>
Wed, 9 Sep 2020 14:09:00 +0000 (22:09 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Sep 2020 21:17:02 +0000 (14:17 -0700)
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@huawei.com>
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c

index ccac7bf2a9d3a862206d01db3f50932dab092740..b1323d5c95b5849e6db26ec710abaca056e85f55 100644 (file)
@@ -149,9 +149,7 @@ static int intel_eth_plat_probe(struct platform_device *pdev)
 
        ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
        if (ret) {
-               if (dwmac->tx_clk)
-                       clk_disable_unprepare(dwmac->tx_clk);
-
+               clk_disable_unprepare(dwmac->tx_clk);
                goto err_remove_config_dt;
        }
 
@@ -169,9 +167,7 @@ static int intel_eth_plat_remove(struct platform_device *pdev)
        int ret;
 
        ret = stmmac_pltfr_remove(pdev);
-
-       if (dwmac->tx_clk)
-               clk_disable_unprepare(dwmac->tx_clk);
+       clk_disable_unprepare(dwmac->tx_clk);
 
        return ret;
 }