public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: phy: fix a return path in get_phy_c45_ids()
@ 2026-04-08 13:31 Charles Perry
  2026-04-08 13:48 ` Andrew Lunn
  0 siblings, 1 reply; 3+ messages in thread
From: Charles Perry @ 2026-04-08 13:31 UTC (permalink / raw)
  To: netdev
  Cc: Charles Perry, Andrew Lunn, Heiner Kallweit, Russell King,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Florian Fainelli, linux-kernel

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: phy: fix a return path in get_phy_c45_ids()
  2026-04-08 13:31 [PATCH net-next] net: phy: fix a return path in get_phy_c45_ids() Charles Perry
@ 2026-04-08 13:48 ` Andrew Lunn
  2026-04-08 14:48   ` Charles Perry
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Lunn @ 2026-04-08 13:48 UTC (permalink / raw)
  To: Charles Perry
  Cc: netdev, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Florian Fainelli,
	linux-kernel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: phy: fix a return path in get_phy_c45_ids()
  2026-04-08 13:48 ` Andrew Lunn
@ 2026-04-08 14:48   ` Charles Perry
  0 siblings, 0 replies; 3+ messages in thread
From: Charles Perry @ 2026-04-08 14:48 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Charles Perry, netdev, Heiner Kallweit, Russell King,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Florian Fainelli, linux-kernel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-08 14:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-08 13:31 [PATCH net-next] net: phy: fix a return path in get_phy_c45_ids() Charles Perry
2026-04-08 13:48 ` Andrew Lunn
2026-04-08 14:48   ` Charles Perry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox