Commit 1c35cc9c authored by Zhang Changzhong's avatar Zhang Changzhong Committed by Jakub Kicinski

net: stmmac: remove redundant null check before clk_disable_unprepare()

Because clk_prepare_enable() and clk_disable_unprepare() already checked
NULL clock parameter, so the additional checks are unnecessary, just
remove them.
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarZhang Changzhong <zhangchangzhong@huawei.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent e50fd9b5
...@@ -788,7 +788,6 @@ static int stmmac_init_ptp(struct stmmac_priv *priv) ...@@ -788,7 +788,6 @@ static int stmmac_init_ptp(struct stmmac_priv *priv)
static void stmmac_release_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); stmmac_ptp_unregister(priv);
} }
...@@ -5108,7 +5107,6 @@ int stmmac_suspend(struct device *dev) ...@@ -5108,7 +5107,6 @@ int stmmac_suspend(struct device *dev)
stmmac_mac_set(priv, priv->ioaddr, false); stmmac_mac_set(priv, priv->ioaddr, false);
pinctrl_pm_select_sleep_state(priv->device); pinctrl_pm_select_sleep_state(priv->device);
/* Disable clock in case of PWM is off */ /* 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->pclk);
clk_disable_unprepare(priv->plat->stmmac_clk); clk_disable_unprepare(priv->plat->stmmac_clk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment