[net-next RFC PATCH 2/6] net: phy: fill phy_id with C45 PHY

From
Christian Marangi <ansuelsmth@gmail.com>
Date
2024-02-18 19:00:47
Also in
lkml
Reply to
Christian Marangi, 2024-02-18
With C45 PHYs that provide PHY ID in C45 Package regs, PHY device
.phy_id is not filled.

Correctly fill .phy_id from matching dev_id or phy_driver info.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
 drivers/net/phy/phy_device.c | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 9b96357e4de8..60a60f182729 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -3476,6 +3476,10 @@ static int phy_probe(struct device *dev)
 		phy_dev_id->phy_id_mask = phydrv->phy_id_mask;
 	}
 
+	/* Fill PHY ID with dev_id if empty and PHY is C45 */
+	if (!phydev->phy_id && phydev->is_c45)
+		phydev->phy_id = phy_dev_id->phy_id;
+
 	/* Disable the interrupt if the PHY doesn't support it
 	 * but the interrupt is still a valid one
 	 */
-- 
2.43.0
Thread (21 messages) 21 messages, 4 authors, last reply 2024-02-19
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help