summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Chevallier <maxime.chevallier@bootlin.com>2026-02-05 12:23:04 +0300
committerJakub Kicinski <kuba@kernel.org>2026-02-13 04:44:55 +0300
commit056166710543a01ebcf25449bb462388e44b6ef6 (patch)
treea28fe735253db8e846b034e20cb6b299a809b63f
parent37a93dd5c49b5fda807fd204edf2547c3493319c (diff)
downloadlinux-056166710543a01ebcf25449bb462388e44b6ef6.tar.xz
net: phy: initialize the port support based on the PHY's for OF ports
With the phy_port infrastructure came an ethernet-connector binding, allowing to represent the MDI of a PHY in devicetree. This allows specifying the mediums and pairs of a port. Let's initialize the port's supported list based on what the PHY reports, so that we can then filter it with what the connector allows using. Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Reviewed-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org> Link: https://patch.msgid.link/20260205092317.755906-2-maxime.chevallier@bootlin.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--drivers/net/phy/phy_device.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 8a3eb1839a3d..9b8eaac63b90 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -3499,6 +3499,9 @@ static int of_phy_ports(struct phy_device *phydev)
port->parent_type = PHY_PORT_PHY;
port->phy = phydev;
+
+ linkmode_copy(port->supported, phydev->supported);
+
err = phy_add_port(phydev, port);
if (err) {
phy_port_destroy(port);