[PATCH net-next v2 13/15] net: ftgmac100: Simplify error handling for ftgmac100_setup_mdio

Jacky Chou posted 15 patches 3 weeks, 2 days ago
There is a newer version of this series
[PATCH net-next v2 13/15] net: ftgmac100: Simplify error handling for ftgmac100_setup_mdio
Posted by Jacky Chou 3 weeks, 2 days ago
From: Andrew Lunn <andrew@lunn.ch>

ftgmac100_setup_mdio() cleans up any resources it gets on error. All
resources obtained 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@lunn.ch>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Jacky Chou <jacky_chou@aspeedtech.com>
---
 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 1440a4b358e3..93c1ef819abc 100644
--- a/drivers/net/ethernet/faraday/ftgmac100.c
+++ b/drivers/net/ethernet/faraday/ftgmac100.c
@@ -2011,7 +2011,7 @@ static int ftgmac100_probe(struct platform_device *pdev)
 	    priv->mac_id == FTGMAC100_AST2500) {
 		err = ftgmac100_setup_mdio(netdev);
 		if (err)
-			goto err_phy_connect;
+			return err;
 	}
 
 	if (np) {

-- 
2.34.1