diff mbox series

net: ag71xx: call phylink_disconnect_phy if ag71xx_hw_enable() fail in ag71xx_open()

Message ID 20221114095549.40342-1-liujian56@huawei.com (mailing list archive)
State Accepted
Commit c9b895c6878bdb6789dc1d7af60fd10f4a9f1937
Delegated to: Netdev Maintainers
Headers show
Series net: ag71xx: call phylink_disconnect_phy if ag71xx_hw_enable() fail in ag71xx_open() | expand

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 15 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Liu Jian Nov. 14, 2022, 9:55 a.m. UTC
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(-)

Comments

Russell King (Oracle) Nov. 14, 2022, 10:49 a.m. UTC | #1
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.
patchwork-bot+netdevbpf@kernel.org Nov. 16, 2022, 4:30 a.m. UTC | #2
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!
diff mbox series

Patch

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;
 }