net: stmmac: remove redundant null check before clk_disable_unprepare()
authorZhang Changzhong <zhangchangzhong@huawei.com>
Mon, 7 Sep 2020 12:57:24 +0000 (20:57 +0800)
committerJakub Kicinski <kuba@kernel.org>
Mon, 7 Sep 2020 20:34:33 +0000 (13:34 -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: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index 89b2b3472852b2179863b8d9f455ff0a8b191870..c553047ff482c9b9fdc1229491b5b13c1a3448ac 100644 (file)
@@ -788,8 +788,7 @@ static int stmmac_init_ptp(struct stmmac_priv *priv)
 
 static void stmmac_release_ptp(struct stmmac_priv *priv)
 {
-       if (priv->plat->clk_ptp_ref)
-               clk_disable_unprepare(priv->plat->clk_ptp_ref);
+       clk_disable_unprepare(priv->plat->clk_ptp_ref);
        stmmac_ptp_unregister(priv);
 }
 
@@ -5108,8 +5107,7 @@ int stmmac_suspend(struct device *dev)
                stmmac_mac_set(priv, priv->ioaddr, false);
                pinctrl_pm_select_sleep_state(priv->device);
                /* Disable clock in case of PWM is off */
-               if (priv->plat->clk_ptp_ref)
-                       clk_disable_unprepare(priv->plat->clk_ptp_ref);
+               clk_disable_unprepare(priv->plat->clk_ptp_ref);
                clk_disable_unprepare(priv->plat->pclk);
                clk_disable_unprepare(priv->plat->stmmac_clk);
        }