drivers/net/phy/phy_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
The return value of phy_c45_probe_present() is store 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: 17b447539408 ("net: phy: c45 scanning: Don't consider -ENODEV fatal")
Signed-off-by: Charles Perry <charles.perry@microchip.com>
---
drivers/net/phy/phy_device.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 81984d4ebb7c..810327fa886a 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -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;
--
2.47.3
On Wed, Apr 08, 2026 at 06:31:44AM -0700, Charles Perry wrote:
> The return value of phy_c45_probe_present() is store 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: 17b447539408 ("net: phy: c45 scanning: Don't consider -ENODEV fatal")
> Signed-off-by: Charles Perry <charles.perry@microchip.com>
Thanks for fixing this.
The Subject line should be [PATCH net] since this is a Fix.
Otherwise:
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
On Wed, Apr 08, 2026 at 03:48:22PM +0200, Andrew Lunn wrote:
> On Wed, Apr 08, 2026 at 06:31:44AM -0700, Charles Perry wrote:
> > The return value of phy_c45_probe_present() is store 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: 17b447539408 ("net: phy: c45 scanning: Don't consider -ENODEV fatal")
> > Signed-off-by: Charles Perry <charles.perry@microchip.com>
>
> Thanks for fixing this.
>
> The Subject line should be [PATCH net] since this is a Fix.
Ok, I'll resend this with the proper patch prefix.
Thanks,
Charles
>
> Otherwise:
>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
>
> Andrew
© 2016 - 2026 Red Hat, Inc.