[PATCH net-next v5 07/15] net: ftgmac100: Simplify error handling for ftgmac100_initial_mac

From: Jacky Chou

Date: Thu Feb 05 2026 - 22:22:34 EST


From: Andrew Lunn <andrew@xxxxxxx>

ftgmac100_initial_mac() does not allocate any resources. All resources
by the probe function up until this call point use devm_ methods. So
just return the error code rather than use a goto.

Signed-off-by: Andrew Lunn <andrew@xxxxxxx>
Reviewed-by: Simon Horman <horms@xxxxxxxxxx>
Signed-off-by: Jacky Chou <jacky_chou@xxxxxxxxxxxxxx>
---
drivers/net/ethernet/faraday/ftgmac100.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
index 1fb03dd55c8f..e511d6d5f7c2 100644
--- a/drivers/net/ethernet/faraday/ftgmac100.c
+++ b/drivers/net/ethernet/faraday/ftgmac100.c
@@ -1914,7 +1914,7 @@ static int ftgmac100_probe(struct platform_device *pdev)
/* MAC address from chip or random one */
err = ftgmac100_initial_mac(priv);
if (err)
- goto err_phy_connect;
+ return err;

if (priv->mac_id == FTGMAC100_AST2400 ||
priv->mac_id == FTGMAC100_AST2500 ||

--
2.34.1