Skip to contentSkip to conversation

net: phy: Make driver overloading get_phy_id depend on !COMPILE_TEST

PATCH New Tom Rini 1 participant 1 message Oct 10, 2025

Subsystems (2)
lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 net: phy: Make driver overloading get_phy_id depend on !COMPILE_TEST

With commit 597fe041a85f ("net/phy: enable get_phy_id redefinable") we made get_phy_id a public but weak function, so that PHY drivers that had required non-standard ways of getting the PHY ID could be supported. However, overloading a weak function multiple times is (rightly) a link error. At this point, we have two PHYs which make use of this feature, so make both of them only available when COMPILE_TEST is unset, as part of being able to support "allyesconfig" in the future.

---
I thought about this a bit, and looking around very quickly in the linux kernel, I don't see how this is abstracted there. Given some of the comments in the two phy drivers that use this, I'm also not sure we could use some other abstraction here as this function is called during probe to figure out what we have.

Cc Jerome Forissier <[email protected]>
---
 drivers/net/phy/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/phy/Kconfig +2 -0
index 185c6a3156e2..018be98705a2 100644
@@ -56,6 +56,7 @@ endif # B53_SWITCH
 
 config MV88E61XX_SWITCH
 	bool "Marvell MV88E61xx Ethernet switch PHY support."
+	depends on !COMPILE_TEST
 
 if MV88E61XX_SWITCH
 
@@ -119,6 +120,7 @@ config PHY_BROADCOM
 
 config PHY_CORTINA
 	bool "Cortina Ethernet PHYs support"
+	depends on !COMPILE_TEST
 
 config SYS_CORTINA_NO_FW_UPLOAD
 	bool "Cortina firmware loading support"
Signature · 1 line
2.43.0