netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: stmmac: disable clocks in stmmac_remove_config_dt()
@ 2021-06-16  9:10 Joakim Zhang
  2021-06-16 19:30 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Joakim Zhang @ 2021-06-16  9:10 UTC (permalink / raw)
  To: davem, kuba, peppe.cavallaro, alexandre.torgue, joabreu, mcoquelin.stm32
  Cc: netdev, linux-kernel, linux-stm32, linux-arm-kernel, linux-imx

Platform drivers may call stmmac_probe_config_dt() to parse dt, could
call stmmac_remove_config_dt() in error handing after dt parsed, so need
disable clocks in stmmac_remove_config_dt().

Go through all platforms drivers which use stmmac_probe_config_dt(),
none of them disable clocks manually, so it's safe to disable them in
stmmac_remove_config_dt().

Fixes: commit d2ed0a7755fe ("net: ethernet: stmmac: fix of-node and fixed-link-phydev leaks")
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 1e17a23d9118..a696ada013eb 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -622,6 +622,8 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
 void stmmac_remove_config_dt(struct platform_device *pdev,
 			     struct plat_stmmacenet_data *plat)
 {
+	clk_disable_unprepare(plat->stmmac_clk);
+	clk_disable_unprepare(plat->pclk);
 	of_node_put(plat->phy_node);
 	of_node_put(plat->mdio_node);
 }
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] net: stmmac: disable clocks in stmmac_remove_config_dt()
  2021-06-16  9:10 [PATCH net] net: stmmac: disable clocks in stmmac_remove_config_dt() Joakim Zhang
@ 2021-06-16 19:30 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-06-16 19:30 UTC (permalink / raw)
  To: Joakim Zhang
  Cc: davem, kuba, peppe.cavallaro, alexandre.torgue, joabreu,
	mcoquelin.stm32, netdev, linux-kernel, linux-stm32,
	linux-arm-kernel, linux-imx

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Wed, 16 Jun 2021 17:10:24 +0800 you wrote:
> Platform drivers may call stmmac_probe_config_dt() to parse dt, could
> call stmmac_remove_config_dt() in error handing after dt parsed, so need
> disable clocks in stmmac_remove_config_dt().
> 
> Go through all platforms drivers which use stmmac_probe_config_dt(),
> none of them disable clocks manually, so it's safe to disable them in
> stmmac_remove_config_dt().
> 
> [...]

Here is the summary with links:
  - [net] net: stmmac: disable clocks in stmmac_remove_config_dt()
    https://git.kernel.org/netdev/net/c/8f269102baf7

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-16 19:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-16  9:10 [PATCH net] net: stmmac: disable clocks in stmmac_remove_config_dt() Joakim Zhang
2021-06-16 19:30 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).