[openwrt/openwrt] realtek: pcs: switch to id from SerDes struct

LEDE Commits lede-commits at lists.infradead.org
Tue Dec 16 04:37:43 PST 2025


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/4d9400f86bea9ea5587d920eb78b9825d796ea95

commit 4d9400f86bea9ea5587d920eb78b9825d796ea95
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Sat Dec 13 20:01:03 2025 +0000

    realtek: pcs: switch to id from SerDes struct
    
    Drop usage of the to-be-phased-out SerDes id stored in rtpcs_link and
    use the reference to the SerDes instance to use the embedded id in
    rtpcs_serdes instead.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/21146
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 .../linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c  | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
index 01b4b3af62..d2a70e65e4 100644
--- a/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
+++ b/target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c
@@ -153,7 +153,6 @@ struct rtpcs_link {
 	struct rtpcs_ctrl *ctrl;
 	struct phylink_pcs pcs;
 	struct rtpcs_serdes *sds;
-	int sds_id;
 	int port;
 };
 
@@ -2920,7 +2919,7 @@ static void rtpcs_pcs_an_restart(struct phylink_pcs *pcs)
 	struct rtpcs_ctrl *ctrl = link->ctrl;
 
 	dev_warn(ctrl->dev, "an_restart() for port %d and sds %d not yet implemented\n",
-		 link->port, link->sds_id);
+		 link->port, link->sds->id);
 }
 
 static int rtpcs_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
@@ -2931,7 +2930,7 @@ static int rtpcs_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
 	struct rtpcs_ctrl *ctrl = link->ctrl;
 	int ret = 0;
 
-	if (link->sds_id < 0)
+	if (link->sds->id < 0)
 		return 0;
 
 	/*
@@ -2941,18 +2940,18 @@ static int rtpcs_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
 	 */
 
 	dev_warn(ctrl->dev, "pcs_config(%s) for port %d and sds %d not yet fully implemented\n",
-		 phy_modes(interface), link->port, link->sds_id);
+		 phy_modes(interface), link->port, link->sds->id);
 
 	mutex_lock(&ctrl->lock);
 
 	if (ctrl->cfg->setup_serdes) {
-		ret = ctrl->cfg->setup_serdes(ctrl, link->sds_id, interface);
+		ret = ctrl->cfg->setup_serdes(ctrl, link->sds->id, interface);
 		if (ret < 0)
 			goto out;
 	}
 
 	if (ctrl->cfg->set_autoneg) {
-		ret = ctrl->cfg->set_autoneg(ctrl, link->sds_id, neg_mode);
+		ret = ctrl->cfg->set_autoneg(ctrl, link->sds->id, neg_mode);
 		if (ret < 0)
 			goto out;
 	}
@@ -3016,7 +3015,6 @@ struct phylink_pcs *rtpcs_create(struct device *dev, struct device_node *np, int
 	link->ctrl = ctrl;
 	link->port = port;
 	link->sds = &ctrl->serdes[sds_id];
-	link->sds_id = sds_id;
 	link->pcs.ops = ctrl->cfg->pcs_ops;
 	link->pcs.neg_mode = true;
 




More information about the lede-commits mailing list