Skip to contentSkip to conversation

net: phy: move definition of genphy_c45_driver to phy_device.c

PATCH Applied Heiner Kallweit 3 participants 3 messages Jun 10, 2025 – Jun 13, 2025

Subsystems (3)
lore
Share & tools
lore

Heiner Kallweit

author maintainer
#0 lore raw

PATCH 1/1 net: phy: move definition of genphy_c45_driver to phy_device.c

genphy_c45_read_status() is exported, so we can move definition of genphy_c45_driver to phy_device.c and make it static. This helps to clean up phy.h a little.

---
 drivers/net/phy/phy-c45.c    | 7 -------
 drivers/net/phy/phy_device.c | 7 +++++++
 include/linux/phy.h          | 3 ---
 3 files changed, 7 insertions(+), 10 deletions(-)
drivers/net/phy/phy-c45.c +0 -7
index bdd70d424..61670be0f 100644
@@ -1573,10 +1573,3 @@ int genphy_c45_ethtool_set_eee(struct phy_device *phydev,
 	return ret;
 }
 EXPORT_SYMBOL(genphy_c45_ethtool_set_eee);
-
-struct phy_driver genphy_c45_driver = {
-	.phy_id         = 0xffffffff,
-	.phy_id_mask    = 0xffffffff,
-	.name           = "Generic Clause 45 PHY",
-	.read_status    = genphy_c45_read_status,
-};
drivers/net/phy/phy_device.c +7 -0
index 73f9cb2e2..2902193e1 100644
@@ -59,6 +59,13 @@ struct phy_fixup {
 	int (*run)(struct phy_device *phydev);
 };
 
+static struct phy_driver genphy_c45_driver = {
+	.phy_id         = 0xffffffff,
+	.phy_id_mask    = 0xffffffff,
+	.name           = "Generic Clause 45 PHY",
+	.read_status    = genphy_c45_read_status,
+};
+
 __ETHTOOL_DECLARE_LINK_MODE_MASK(phy_basic_features) __ro_after_init;
 EXPORT_SYMBOL_GPL(phy_basic_features);
 
include/linux/phy.h +0 -3
index e194dad16..c021b351a 100644
@@ -1941,9 +1941,6 @@ int genphy_c45_ethtool_set_eee(struct phy_device *phydev,
 			       struct ethtool_keee *data);
 int genphy_c45_an_config_eee_aneg(struct phy_device *phydev);
 
-/* Generic C45 PHY driver */
-extern struct phy_driver genphy_c45_driver;
-
 /* The gen10g_* functions are the old Clause 45 stub */
 int gen10g_config_aneg(struct phy_device *phydev);
 
Signature · 1 line
2.49.0
#2 lore raw
In reply to Heiner Kallweit
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Tue, 10 Jun 2025 23:34:53 +0200 you wrote:

genphy_c45_read_status() is exported, so we can move definition of genphy_c45_driver to phy_device.c and make it static. This helps to clean up phy.h a little.

---
 drivers/net/phy/phy-c45.c    | 7 -------
 drivers/net/phy/phy_device.c | 7 +++++++
 include/linux/phy.h          | 3 ---
 3 files changed, 7 insertions(+), 10 deletions(-)

Here is the summary with links:
- [net-next] net: phy: move definition of genphy_c45_driver to phy_device.c

    https://git.kernel.org/netdev/net-next/c/00ee2537255e

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html