Skip to content

Commit de1e963

Browse files
Russell King (Oracle)kuba-moo
authored andcommitted
net: stmmac: rk: put the PHY clock on remove
The PHY clock (bsp_priv->clk_phy) is obtained using of_clk_get(), which doesn't take part in the devm release. Therefore, when a device is unbound, this clock needs to be explicitly put. Fix this. Signed-off-by: Russell King (Oracle) <[email protected]> Reviewed-by: Simon Horman <[email protected]> Fixes: fecd4d7 ("net: stmmac: dwmac-rk: Add integrated PHY support") Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 52966bf commit de1e963

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1765,11 +1765,15 @@ static int rk_gmac_probe(struct platform_device *pdev)
17651765

17661766
static void rk_gmac_remove(struct platform_device *pdev)
17671767
{
1768-
struct rk_priv_data *bsp_priv = get_stmmac_bsp_priv(&pdev->dev);
1768+
struct stmmac_priv *priv = netdev_priv(platform_get_drvdata(pdev));
1769+
struct rk_priv_data *bsp_priv = priv->plat->bsp_priv;
17691770

17701771
stmmac_dvr_remove(&pdev->dev);
17711772

17721773
rk_gmac_powerdown(bsp_priv);
1774+
1775+
if (priv->plat->phy_node && bsp_priv->integrated_phy)
1776+
clk_put(bsp_priv->clk_phy);
17731777
}
17741778

17751779
#ifdef CONFIG_PM_SLEEP

0 commit comments

Comments
 (0)