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: Hulk Robot <hulkci@huawei.com> Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
e50fd9b579
commit
1c35cc9cf6
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user