staging: rtl8188eu: simplify phy_lc_calibrate
authorMartin Kaiser <martin@kaiser.cx>
Sun, 25 Jul 2021 15:59:01 +0000 (17:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Jul 2021 13:19:28 +0000 (15:19 +0200)
phy_lc_calibrate's is2t parameter is always false.
Remove some code that would be called only for is2t == true.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210725155902.32433-17-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/hal/phy.c

index a6181b9..2887559 100644 (file)
@@ -952,10 +952,10 @@ static void phy_iq_calibrate(struct adapter *adapt, s32 result[][8],
        }
 }
 
-static void phy_lc_calibrate(struct adapter *adapt, bool is2t)
+static void phy_lc_calibrate(struct adapter *adapt)
 {
        u8 tmpreg;
-       u32 rf_a_mode = 0, rf_b_mode = 0, lc_cal;
+       u32 rf_a_mode = 0, lc_cal;
 
        /* Check continuous TX and Packet TX */
        tmpreg = usb_read8(adapt, 0xd03);
@@ -971,20 +971,10 @@ static void phy_lc_calibrate(struct adapter *adapt, bool is2t)
                rf_a_mode = rtw_hal_read_rfreg(adapt, RF_PATH_A, RF_AC,
                                               bMask12Bits);
 
-               /* Path-B */
-               if (is2t)
-                       rf_b_mode = rtw_hal_read_rfreg(adapt, RF_PATH_B, RF_AC,
-                                                      bMask12Bits);
-
                /* 2. Set RF mode = standby mode */
                /* Path-A */
                phy_set_rf_reg(adapt, RF_PATH_A, RF_AC, bMask12Bits,
                               (rf_a_mode & 0x8FFFF) | 0x10000);
-
-               /* Path-B */
-               if (is2t)
-                       phy_set_rf_reg(adapt, RF_PATH_B, RF_AC, bMask12Bits,
-                                      (rf_b_mode & 0x8FFFF) | 0x10000);
        }
 
        /* 3. Read RF reg18 */
@@ -1003,10 +993,6 @@ static void phy_lc_calibrate(struct adapter *adapt, bool is2t)
                usb_write8(adapt, 0xd03, tmpreg);
                phy_set_rf_reg(adapt, RF_PATH_A, RF_AC, bMask12Bits, rf_a_mode);
 
-               /* Path-B */
-               if (is2t)
-                       phy_set_rf_reg(adapt, RF_PATH_B, RF_AC, bMask12Bits,
-                                      rf_b_mode);
        } else {
                /* Deal with Packet TX case */
                usb_write8(adapt, REG_TXPAUSE, 0x00);
@@ -1126,7 +1112,7 @@ void rtl88eu_phy_lc_calibrate(struct adapter *adapt)
 
        dm_odm->RFCalibrateInfo.bLCKInProgress = true;
 
-       phy_lc_calibrate(adapt, false);
+       phy_lc_calibrate(adapt);
 
        dm_odm->RFCalibrateInfo.bLCKInProgress = false;
 }