]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: fix Zyxel GS1900-10HP SFP slots
authorBjørn Mork <bjorn@mork.no>
Mon, 29 Sep 2025 06:13:19 +0000 (08:13 +0200)
committerRobert Marko <robimarko@gmail.com>
Mon, 29 Sep 2025 18:54:19 +0000 (20:54 +0200)
Parse the pcs-handle property regardless of phy-handle

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Link: https://github.com/openwrt/openwrt/pull/20228
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c

index 6bae35633d36c86fb318defe3b5ae8850d16e424..c805d954ec9e07d3be0b19fc01afa790ca0a96f6 100644 (file)
@@ -334,6 +334,9 @@ static int __init rtl83xx_mdio_probe(struct rtl838x_switch_priv *priv)
                if (of_property_read_u32(dn, "reg", &pn))
                        continue;
 
+               pcs_node = of_parse_phandle(dn, "pcs-handle", 0);
+               priv->pcs[pn] = rtpcs_create(priv->dev, pcs_node, pn);
+
                phy_node = of_parse_phandle(dn, "phy-handle", 0);
                if (!phy_node) {
                        if (pn != priv->cpu_port)
@@ -341,9 +344,6 @@ static int __init rtl83xx_mdio_probe(struct rtl838x_switch_priv *priv)
                        continue;
                }
 
-               pcs_node = of_parse_phandle(dn, "pcs-handle", 0);
-               priv->pcs[pn] = rtpcs_create(priv->dev, pcs_node, pn);
-
                /*
                 * TODO: phylink_pcs was completely converted to the standalone PCS driver - see
                 * rtpcs_create(). Nevertheless the DSA driver still relies on the info about the