Skip to contentSkip to conversation

net: phy: air_en8811h: simplify en8811h_probe() trailing return

PATCH In review Vitaliy Sochnev 2 participants 2 messages Sep 6 – Sep 10

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: phy: air_en8811h: simplify en8811h_probe() trailing return

en8811h_clk_provider_setup() is now the last statement in the function, so the intermediate "if (ret) return ret; return 0;" is redundant.

---
 drivers/net/phy/air_en8811h.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/net/phy/air_en8811h.c +1 -5
index ec7c44ca68e7..99221ee87977 100644
@@ -1168,11 +1168,7 @@ static int en8811h_probe(struct phy_device *phydev)
 
 	priv->phydev = phydev;
 	/* Co-Clock Output */
-	ret = en8811h_clk_provider_setup(&phydev->mdio.dev, &priv->hw);
-	if (ret)
-		return ret;
-
-	return 0;
+	return en8811h_clk_provider_setup(&phydev->mdio.dev, &priv->hw);
 }
 
 static int an8811hb_config_serdes_polarity(struct phy_device *phydev)
Signature · 1 line
2.55.0
maintainer
#1 lore raw
Quoted 16 lines · On Sun, 6 Sep 2026 20:35:57 +0100 Vitaliy Sochnev wrote:

en8811h_clk_provider_setup() is now the last statement in the function, so the intermediate "if (ret) return ret; return 0;" is redundant.

---
 drivers/net/phy/air_en8811h.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/net/phy/air_en8811h.c +0 -0
index ec7c44ca68e7..99221ee87977 100644
@@ -1168,11 +1168,7 @@ static int en8811h_probe(struct phy_device *phydev)
 
 	priv->phydev = phydev;

drivers/net/phy/air_en8811h.c static int en8811h_probe(struct phy_device *phydev) · line 1174

Quoted 10 lines
drivers/net/phy/air_en8811h.c +1 -5
 	/* Co-Clock Output */
-	ret = en8811h_clk_provider_setup(&phydev->mdio.dev, &priv->hw);
-	if (ret)
-		return ret;
-
-	return 0;
+	return en8811h_clk_provider_setup(&phydev->mdio.dev, &priv->hw);
 }
 
 static int an8811hb_config_serdes_polarity(struct phy_device *phydev)

It's a personal preference, someone may think it's better to keep the ret handling separate to avoid changing git blame when more code is added. The shorter version is probably slightly better but not enough to justify a cleanup of this sort IMO, sorry.