Skip to contentSkip to conversation

net: lan743x: Use correct variable in lan743x_sgmii_config()

PATCH Applied Dan Carpenter 3 participants 3 messages Jun 23, 2022 – Jun 24, 2022

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

PATCH 1/1 net: lan743x: Use correct variable in lan743x_sgmii_config()

There is a copy and paste bug in lan743x_sgmii_config() so it checks if (ret < 0) instead of if (mii_ctl < 0).

Fixes 46b777ad9a8c ("net: lan743x: Add support to SGMII 1G and 2.5G")
---
 drivers/net/ethernet/microchip/lan743x_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/microchip/lan743x_main.c +2 -2
index 79ecf296161e..a9a1dea6d731 100644
@@ -1212,8 +1212,8 @@ static int lan743x_sgmii_config(struct lan743x_adapter *adapter)
 
 	/* SGMII/1000/2500BASE-X PCS power down */
 	mii_ctl = lan743x_sgmii_read(adapter, MDIO_MMD_VEND2, MII_BMCR);
-	if (ret < 0)
-		return ret;
+	if (mii_ctl < 0)
+		return mii_ctl;
 
 	mii_ctl |= BMCR_PDOWN;
 	ret = lan743x_sgmii_write(adapter, MDIO_MMD_VEND2, MII_BMCR, mii_ctl);
Signature · 1 line
2.35.1
#2 lore raw
In reply to Dan Carpenter
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Thu, 23 Jun 2022 16:34:03 +0300 you wrote:

There is a copy and paste bug in lan743x_sgmii_config() so it checks if (ret < 0) instead of if (mii_ctl < 0).

Fixes 46b777ad9a8c ("net: lan743x: Add support to SGMII 1G and 2.5G")
---
 drivers/net/ethernet/microchip/lan743x_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Here is the summary with links:
- [net-next] net: lan743x: Use correct variable in lan743x_sgmii_config()

    https://git.kernel.org/netdev/net-next/c/b4cbd7a9339f

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html