Commit 6f533abe authored by Charles Perry's avatar Charles Perry Committed by Jakub Kicinski
Browse files

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.

Fixes: 17b44753 ("net: phy: c45 scanning: Don't consider -ENODEV fatal")
Signed-off-by: default avatarCharles Perry <charles.perry@microchip.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Reviewed-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/20260409133654.3203336-1-charles.perry@microchip.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent e4df9f02
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -927,8 +927,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;