]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: pcs: rtl930x: use param instead of register read
authorJonas Jelonek <jelonek.jonas@gmail.com>
Thu, 5 Mar 2026 22:01:19 +0000 (22:01 +0000)
committerRobert Marko <robimarko@gmail.com>
Sat, 21 Mar 2026 22:06:10 +0000 (23:06 +0100)
Instead of performing a dedicated register read we can rely on the mode
that is passed via a parameter to the function. The code flow ensures
that this is the same value in this place.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/22450
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c

index dfdab611298a2a5acc9be6ec3af5791e8b3b8dda..2f66d3c4728def7a79c042e508a80663ad674ed9 100644 (file)
@@ -2502,8 +2502,8 @@ static void rtpcs_930x_sds_do_rx_calibration(struct rtpcs_serdes *sds,
        rtpcs_930x_sds_do_rx_calibration_5(sds, hw_mode);
        mdelay(20);
 
-       /* Do this only for 10GR mode, SDS active in mode 0x1a */
-       if (rtpcs_sds_read_bits(sds, 0x1f, 9, 11, 7) == RTPCS_930X_SDS_MODE_10GBASER) {
+       /* Do this only for 10GR mode */
+       if (hw_mode == RTPCS_SDS_MODE_10GBASER) {
                pr_info("%s: SDS enabled\n", __func__);
                latch_sts = rtpcs_sds_read_bits(sds, 0x4, 1, 2, 2);
                mdelay(1);