Netdev List
 help / color / mirror / Atom feed
* [PATCH] net: phy: use generic clause 45 autonegotiation done
@ 2018-07-18 13:12 Camelia Groza
  2018-07-18 14:39 ` Andrew Lunn
  2018-07-27 13:41 ` Camelia Alexandra Groza
  0 siblings, 2 replies; 7+ messages in thread
From: Camelia Groza @ 2018-07-18 13:12 UTC (permalink / raw)
  To: andrew, f.fainelli, davem; +Cc: netdev, linux-kernel, Camelia Groza

Only Clause 22 PHYs can use genphy_aneg_done(). Use
genphy_c45_aneg_done() for PHYs that implement Clause 45 without
the Clause 22 register set.

This change follows the model of phy_restart_aneg() which
differentiates between the two implementations in a similar way.

Fixes: 41408ad519f7 ("net: phy: avoid genphy_aneg_done() for PHYs without clause 22 support")
Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
---
 drivers/net/phy/phy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 537297d..4fcc703 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -151,7 +151,7 @@ int phy_aneg_done(struct phy_device *phydev)
 	 * implement Clause 22 registers
 	 */
 	if (phydev->is_c45 && !(phydev->c45_ids.devices_in_package & BIT(0)))
-		return -EINVAL;
+		return genphy_c45_aneg_done(phydev);
 
 	return genphy_aneg_done(phydev);
 }
-- 
1.9.1

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

end of thread, other threads:[~2018-07-27 13:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-18 13:12 [PATCH] net: phy: use generic clause 45 autonegotiation done Camelia Groza
2018-07-18 14:39 ` Andrew Lunn
2018-07-19 12:47   ` Camelia Alexandra Groza
2018-07-19 12:56     ` Russell King - ARM Linux
2018-07-19 14:49       ` Andrew Lunn
2018-07-23 15:14     ` Camelia Alexandra Groza
2018-07-27 13:41 ` Camelia Alexandra Groza

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