]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: dsa,pcs: drop rtpcs_create 23539/head
authorJonas Jelonek <jelonek.jonas@gmail.com>
Tue, 26 May 2026 06:58:14 +0000 (06:58 +0000)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Sun, 31 May 2026 10:52:41 +0000 (12:52 +0200)
Drop the shared rtpcs_create function and references in both drivers
since that is now done via the fwnode PCS provider framework.

Link: https://github.com/openwrt/openwrt/pull/23539
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
target/linux/realtek/files-6.18/drivers/net/dsa/rtl83xx/common.c
target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c

index a85bf1087fd3590d7570070476e710c3a0bafb61..88e7984b8b593afbaf4beb68cddbd5f0420fde98 100644 (file)
@@ -16,8 +16,6 @@
 
 #include "rtl-otto.h"
 
-struct phylink_pcs *rtpcs_create(struct device *dev, struct device_node *np, int link_idx, int port);
-
 int rtldsa_port_get_stp_state(struct rtl838x_switch_priv *priv, int port)
 {
        u32 msti = 0;
index cbfeee50b68a2aaf1c1b85d353234b0643a82d01..3a48b4e35dd680a91cc02edec4fa3abe3c9aba00 100644 (file)
@@ -4135,81 +4135,6 @@ out:
        return ret;
 }
 
-struct phylink_pcs *rtpcs_create(struct device *dev, struct device_node *np, int link_idx, int port);
-struct phylink_pcs *rtpcs_create(struct device *dev, struct device_node *np, int link_idx, int port)
-{
-       struct platform_device *pdev;
-       struct device_node *pcs_np;
-       struct rtpcs_serdes *sds;
-       struct rtpcs_ctrl *ctrl;
-       struct rtpcs_link *link;
-       u32 sds_id;
-
-       if (!np || !of_device_is_available(np))
-               return ERR_PTR(-ENODEV);
-
-       pcs_np = of_get_parent(np);
-       if (!pcs_np)
-               return ERR_PTR(-ENODEV);
-
-       if (!of_device_is_available(pcs_np)) {
-               of_node_put(pcs_np);
-               return ERR_PTR(-ENODEV);
-       }
-
-       pdev = of_find_device_by_node(pcs_np);
-       of_node_put(pcs_np);
-       if (!pdev)
-               return ERR_PTR(-EPROBE_DEFER);
-
-       ctrl = platform_get_drvdata(pdev);
-       if (!ctrl) {
-               put_device(&pdev->dev);
-               return ERR_PTR(-EPROBE_DEFER);
-       }
-
-       if (port < 0 || port > ctrl->cfg->cpu_port)
-               return ERR_PTR(-EINVAL);
-
-       if (of_property_read_u32(np, "reg", &sds_id))
-               return ERR_PTR(-EINVAL);
-       if (sds_id >= ctrl->cfg->serdes_count)
-               return ERR_PTR(-EINVAL);
-
-       sds = &ctrl->serdes[sds_id];
-       if (rtpcs_sds_read(sds, 0, 0) < 0)
-               return ERR_PTR(-EINVAL);
-
-       if (link_idx >= RTPCS_MAX_LINKS_PER_SDS) {
-               put_device(&pdev->dev);
-               return ERR_PTR(-EINVAL);
-       }
-       if (sds->link[link_idx]) {
-               put_device(&pdev->dev);
-               return ERR_PTR(-EBUSY);
-       }
-
-       link = devm_kzalloc(ctrl->dev, sizeof(*link), GFP_KERNEL);
-       if (!link) {
-               put_device(&pdev->dev);
-               return ERR_PTR(-ENOMEM);
-       }
-
-       device_link_add(dev, ctrl->dev, DL_FLAG_AUTOREMOVE_CONSUMER);
-
-       link->ctrl = ctrl;
-       link->port = port;
-       link->sds = sds;
-       link->pcs.ops = ctrl->cfg->pcs_ops;
-
-       sds->link[link_idx] = link;
-
-       dev_dbg(ctrl->dev, "phylink_pcs created, port %d, sds %d, link_idx %d\n",
-               port, sds_id, link_idx);
-       return &link->pcs;
-}
-EXPORT_SYMBOL(rtpcs_create);
-
 static struct mii_bus *rtpcs_probe_serdes_bus(struct rtpcs_ctrl *ctrl)
 {
        struct device_node *np;
@@ -4439,10 +4364,6 @@ static int rtpcs_probe(struct platform_device *pdev)
                        return ret;
        }
 
-       /*
-        * rtpcs_create() relies on that fact that data is attached to the platform device to
-        * determine if the driver is ready. Do this after everything is initialized properly.
-        */
        platform_set_drvdata(pdev, ctrl);
 
        for (i = 0; i < ctrl->cfg->serdes_count; i++) {