Skip to content

Commit 15a9928

Browse files
ch-perrygregkh
authored andcommitted
net: phy: fix a return path in get_phy_c45_ids()
[ Upstream commit 6f533ab ] 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. Fixes: 17b4475 ("net: phy: c45 scanning: Don't consider -ENODEV fatal") Signed-off-by: Charles Perry <charles.perry@microchip.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Link: https://patch.msgid.link/20260409133654.3203336-1-charles.perry@microchip.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent d7637c4 commit 15a9928

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/net/phy/phy_device.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -963,8 +963,8 @@ static int get_phy_c45_ids(struct mii_bus *bus, int addr,
963963
/* returning -ENODEV doesn't stop bus
964964
* scanning
965965
*/
966-
return (phy_reg == -EIO ||
967-
phy_reg == -ENODEV) ? -ENODEV : -EIO;
966+
return (ret == -EIO ||
967+
ret == -ENODEV) ? -ENODEV : -EIO;
968968

969969
if (!ret)
970970
continue;

0 commit comments

Comments
 (0)