net: phy: fix a return path in get_phy_c45_ids()
Subsystems (3)
PATCH v2 1/1 net: phy: fix a return path in get_phy_c45_ids()
The return value of phy_c45_probe_present() is stored in "ret", not "phy_reg", fix this. "phy_reg" always has a positive value if we reach this return path (since it would have returned earlier otherwise), which means that the original goal of the patch of not considering -ENODEV fatal wasn't achieved.
---
Notes:
Changes in v2:
- Collect Andrew's Reviewed-by
- Send to net instead of net-next
- fix one typo in the commit message
drivers/net/phy/phy_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/phy/phy_device.c +2 -2
@@ -973,8 +973,8 @@ static int get_phy_c45_ids(struct mii_bus *bus, int addr,/* returning -ENODEV doesn't stop bus * scanning */ -return (phy_reg == -EIO || - phy_reg == -ENODEV ) ? -ENODEV : -EIO ; +return (ret == -EIO || + ret == -ENODEV ) ? -ENODEV : -EIO ;if (!ret)continue ;
Signature · 1 line
2.47.3
Quoted 9 lines · Charles Perry
The return value of
phy_c45_probe_present()is stored in "ret", not "phy_reg", fix this. "phy_reg" always has a positive value if we reach this return path (since it would have returned earlier otherwise), which means that the original goal of the patch of not considering-ENODEVfatal wasn't achieved.Fixes 17b447539408 ("net: phy: c45 scanning: Don't consider -ENODEV fatal")Signed-off-by Charles Perry <[email protected]>Reviewed-by Andrew Lunn <[email protected]>
Thanks!
Note: you don't need to resend just because you've received another r-b.
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 11 lines · On Thu, 9 Apr 2026 06:36:54 -0700 you wrote:
The return value of
phy_c45_probe_present()is stored in "ret", not "phy_reg", fix this. "phy_reg" always has a positive value if we reach this return path (since it would have returned earlier otherwise), which means that the original goal of the patch of not considering-ENODEVfatal wasn't achieved.Fixes 17b447539408 ("net: phy: c45 scanning: Don't consider -ENODEV fatal")Signed-off-by Charles Perry <[email protected]>Reviewed-by Andrew Lunn <[email protected]>[...]
Here is the summary with links:
- [net,v2] net: phy: fix a return path in get_phy_c45_ids()
https://git.kernel.org/netdev/net/c/6f533abe7bba
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html