scsi: ufs: ufs-qcom: Use common ADAPT configuration function
authorStanley Chu <stanley.chu@mediatek.com>
Mon, 16 Nov 2020 06:50:54 +0000 (14:50 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 17 Nov 2020 06:03:18 +0000 (01:03 -0500)
Use common ADAPT configuration function to reduce duplicated code in UFS
drivers.

Link: https://lore.kernel.org/r/20201116065054.7658-10-stanley.chu@mediatek.com
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufs-qcom.c

index 04adfbd1075312a67071e520c2c4ee34cd6a0fe7..1e434cce0f79bd6b0fa46ab0a6f8a30e6bc79423 100644 (file)
@@ -723,17 +723,9 @@ static int ufs_qcom_pwr_change_notify(struct ufs_hba *hba,
                        ufs_qcom_dev_ref_clk_ctrl(host, true);
 
                if (host->hw_ver.major >= 0x4) {
-                       if (dev_req_params->gear_tx == UFS_HS_G4) {
-                               /* INITIAL ADAPT */
-                               ufshcd_dme_set(hba,
-                                              UIC_ARG_MIB(PA_TXHSADAPTTYPE),
-                                              PA_INITIAL_ADAPT);
-                       } else {
-                               /* NO ADAPT */
-                               ufshcd_dme_set(hba,
-                                              UIC_ARG_MIB(PA_TXHSADAPTTYPE),
-                                              PA_NO_ADAPT);
-                       }
+                       ufshcd_dme_configure_adapt(hba,
+                                               dev_req_params->gear_tx,
+                                               PA_INITIAL_ADAPT);
                }
                break;
        case POST_CHANGE: