Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Simon Horman <horms@kernel.org>
Fixes: fecd4d7eef8b ("net: stmmac: dwmac-rk: Add integrated PHY support")
Link: https://patch.msgid.link/E1ukM1S-0086qo-PC@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Russell King (Oracle) and committed by
Jakub Kicinski
de1e963a 52966bf7

+5 -1
+5 -1
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
··· 1765 1765 1766 1766 static void rk_gmac_remove(struct platform_device *pdev) 1767 1767 { 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; 1769 1770 1770 1771 stmmac_dvr_remove(&pdev->dev); 1771 1772 1772 1773 rk_gmac_powerdown(bsp_priv); 1774 + 1775 + if (priv->plat->phy_node && bsp_priv->integrated_phy) 1776 + clk_put(bsp_priv->clk_phy); 1773 1777 } 1774 1778 1775 1779 #ifdef CONFIG_PM_SLEEP