realtek: 5.15: rtl93xx: remove unused SerDes mode selection
authorTobias Schramm <tobias@t-sys.eu>
Sun, 4 Feb 2024 14:15:49 +0000 (15:15 +0100)
committerSander Vanheule <sander@svanheule.net>
Mon, 5 Feb 2024 19:44:46 +0000 (20:44 +0100)
rtl93xx_phylink_mac_config used to determine sds_mode without ever using
it. Drop that code.

Signed-off-by: Tobias Schramm <tobias@t-sys.eu>
target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c

index a5b8ccea1c8c629d085d25245b6f8c5b7249fec4..759ca94e000e81a5771183ff390998723b77be38 100644 (file)
@@ -796,7 +796,7 @@ static void rtl93xx_phylink_mac_config(struct dsa_switch *ds, int port,
                                        const struct phylink_link_state *state)
 {
        struct rtl838x_switch_priv *priv = ds->priv;
-       int sds_num, sds_mode;
+       int sds_num;
        u32 reg;
 
        pr_info("%s port %d, mode %x, phy-mode: %s, speed %d, link %d\n", __func__,
@@ -811,32 +811,8 @@ static void rtl93xx_phylink_mac_config(struct dsa_switch *ds, int port,
 
        sds_num = priv->ports[port].sds_num;
        pr_info("%s SDS is %d\n", __func__, sds_num);
-       if (sds_num >= 0) {
-               switch (state->interface) {
-               case PHY_INTERFACE_MODE_HSGMII:
-                       sds_mode = 0x12;
-                       break;
-               case PHY_INTERFACE_MODE_1000BASEX:
-                       sds_mode = 0x04;
-                       break;
-               case PHY_INTERFACE_MODE_XGMII:
-                       sds_mode = 0x10;
-                       break;
-               case PHY_INTERFACE_MODE_10GBASER:
-               case PHY_INTERFACE_MODE_10GKR:
-                       sds_mode = 0x1b; /* 10G 1000X Auto */
-                       break;
-               case PHY_INTERFACE_MODE_USXGMII:
-                       sds_mode = 0x0d;
-                       break;
-               default:
-                       pr_err("%s: unknown serdes mode: %s\n",
-                              __func__, phy_modes(state->interface));
-                       return;
-               }
-               if (state->interface == PHY_INTERFACE_MODE_10GBASER)
-                       rtl9300_serdes_setup(sds_num, state->interface);
-       }
+       if (sds_num >= 0 && state->interface == PHY_INTERFACE_MODE_10GBASER)
+               rtl9300_serdes_setup(sds_num, state->interface);
 
        reg = sw_r32(priv->r->mac_force_mode_ctrl(port));
        reg &= ~(0xf << 3);