[net-next RFC PATCH 2/6] net: phy: fill phy_id with C45 PHY
From: Christian Marangi
Date: Sun Feb 18 2024 - 14:03:19 EST
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@xxxxxxxxx>
---
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