From: Tobias Schramm Date: Sun, 4 Feb 2024 14:15:49 +0000 (+0100) Subject: realtek: 5.15: rtl93xx: remove unused SerDes mode selection X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=9b066384f99569489626e147ba38514d038061d9;p=openwrt%2Fstaging%2Fnbd.git realtek: 5.15: rtl93xx: remove unused SerDes mode selection rtl93xx_phylink_mac_config used to determine sds_mode without ever using it. Drop that code. Signed-off-by: Tobias Schramm --- diff --git a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c index a5b8ccea1c..759ca94e00 100644 --- a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c +++ b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/dsa.c @@ -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);