netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: ag71xx: call phylink_disconnect_phy if ag71xx_hw_enable() fail in ag71xx_open()
@ 2022-11-14  9:55 Liu Jian
  2022-11-14 10:49 ` Russell King (Oracle)
  2022-11-16  4:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Liu Jian @ 2022-11-14  9:55 UTC (permalink / raw)
  To: chris.snook, davem, edumazet, kuba, pabeni, linux, linux, netdev
  Cc: liujian56

If ag71xx_hw_enable() fails, call phylink_disconnect_phy() to clean up.
And if phylink_of_phy_connect() fails, nothing needs to be done.
Compile tested only.

Fixes: 892e09153fa3 ("net: ag71xx: port to phylink")
Signed-off-by: Liu Jian <liujian56@huawei.com>
---
 drivers/net/ethernet/atheros/ag71xx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/atheros/ag71xx.c b/drivers/net/ethernet/atheros/ag71xx.c
index cc932b3cf873..4a1efe9b37d0 100644
--- a/drivers/net/ethernet/atheros/ag71xx.c
+++ b/drivers/net/ethernet/atheros/ag71xx.c
@@ -1427,7 +1427,7 @@ static int ag71xx_open(struct net_device *ndev)
 	if (ret) {
 		netif_err(ag, link, ndev, "phylink_of_phy_connect filed with err: %i\n",
 			  ret);
-		goto err;
+		return ret;
 	}
 
 	max_frame_len = ag71xx_max_frame_len(ndev->mtu);
@@ -1448,6 +1448,7 @@ static int ag71xx_open(struct net_device *ndev)
 
 err:
 	ag71xx_rings_cleanup(ag);
+	phylink_disconnect_phy(ag->phylink);
 	return ret;
 }
 
-- 
2.17.1


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

* Re: [PATCH] net: ag71xx: call phylink_disconnect_phy if ag71xx_hw_enable() fail in ag71xx_open()
  2022-11-14  9:55 [PATCH] net: ag71xx: call phylink_disconnect_phy if ag71xx_hw_enable() fail in ag71xx_open() Liu Jian
@ 2022-11-14 10:49 ` Russell King (Oracle)
  2022-11-16  4:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Russell King (Oracle) @ 2022-11-14 10:49 UTC (permalink / raw)
  To: Liu Jian; +Cc: chris.snook, davem, edumazet, kuba, pabeni, linux, netdev

On Mon, Nov 14, 2022 at 05:55:49PM +0800, Liu Jian wrote:
> If ag71xx_hw_enable() fails, call phylink_disconnect_phy() to clean up.
> And if phylink_of_phy_connect() fails, nothing needs to be done.
> Compile tested only.
> 
> Fixes: 892e09153fa3 ("net: ag71xx: port to phylink")
> Signed-off-by: Liu Jian <liujian56@huawei.com>

LGTM.

Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Thanks.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

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

* Re: [PATCH] net: ag71xx: call phylink_disconnect_phy if ag71xx_hw_enable() fail in ag71xx_open()
  2022-11-14  9:55 [PATCH] net: ag71xx: call phylink_disconnect_phy if ag71xx_hw_enable() fail in ag71xx_open() Liu Jian
  2022-11-14 10:49 ` Russell King (Oracle)
@ 2022-11-16  4:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-11-16  4:30 UTC (permalink / raw)
  To: Liu Jian; +Cc: chris.snook, davem, edumazet, kuba, pabeni, linux, linux, netdev

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 14 Nov 2022 17:55:49 +0800 you wrote:
> If ag71xx_hw_enable() fails, call phylink_disconnect_phy() to clean up.
> And if phylink_of_phy_connect() fails, nothing needs to be done.
> Compile tested only.
> 
> Fixes: 892e09153fa3 ("net: ag71xx: port to phylink")
> Signed-off-by: Liu Jian <liujian56@huawei.com>
> 
> [...]

Here is the summary with links:
  - net: ag71xx: call phylink_disconnect_phy if ag71xx_hw_enable() fail in ag71xx_open()
    https://git.kernel.org/netdev/net/c/c9b895c6878b

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] 3+ messages in thread

end of thread, other threads:[~2022-11-16  4:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-14  9:55 [PATCH] net: ag71xx: call phylink_disconnect_phy if ag71xx_hw_enable() fail in ag71xx_open() Liu Jian
2022-11-14 10:49 ` Russell King (Oracle)
2022-11-16  4: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).