]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
scsi: ufs: ufs-qcom: Remove redundant re-assignment to hs_rate
authorRam Kumar Dwivedi <quic_rdwivedi@quicinc.com>
Wed, 17 Sep 2025 14:09:31 +0000 (19:39 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 25 Sep 2025 02:27:47 +0000 (22:27 -0400)
Remove the redundant else block that assigns PA_HS_MODE_B to hs_rate, as
it is already assigned in ufshcd_init_host_params(). This avoids
unnecessary reassignment and prevents overwriting hs_rate when it is
explicitly set to a different value.

Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Signed-off-by: Ram Kumar Dwivedi <quic_rdwivedi@quicinc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/ufs/host/ufs-qcom.c

index 76fc70503a62eb2e747b2d4cd18cc05b6f5526c7..4b8afaf12f2e5768931cc59d73ab8b0e82785233 100644 (file)
@@ -494,12 +494,8 @@ static int ufs_qcom_power_up_sequence(struct ufs_hba *hba)
         * If the HS-G5 PHY gear is used, update host_params->hs_rate to Rate-A,
         * so that the subsequent power mode change shall stick to Rate-A.
         */
-       if (host->hw_ver.major == 0x5) {
-               if (host->phy_gear == UFS_HS_G5)
-                       host_params->hs_rate = PA_HS_MODE_A;
-               else
-                       host_params->hs_rate = PA_HS_MODE_B;
-       }
+       if (host->hw_ver.major == 0x5 && host->phy_gear == UFS_HS_G5)
+               host_params->hs_rate = PA_HS_MODE_A;
 
        mode = host_params->hs_rate == PA_HS_MODE_B ? PHY_MODE_UFS_HS_B : PHY_MODE_UFS_HS_A;