diff options
author | Stanley Chu <stanley.chu@mediatek.com> | 2020-11-16 14:50:53 +0800 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2020-11-17 01:03:18 -0500 |
commit | e1e25d1b89967035059cf8e098270cc3300b5bd9 (patch) | |
tree | cfeaeb33e0ad3c16fac94721292218adb118aaa8 /drivers/scsi | |
parent | fc85a74e28fe087dceb80eb69f37307ec97b6b47 (diff) |
scsi: ufs: ufs-mediatek: Use common ADAPT configuration function
Use common ADAPT configuration function to reduce duplicated code in UFS
drivers.
Link: https://lore.kernel.org/r/20201116065054.7658-9-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>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/ufs/ufs-mediatek.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/scsi/ufs/ufs-mediatek.c b/drivers/scsi/ufs/ufs-mediatek.c index 87b4bf125e23..1d3c5cd4592e 100644 --- a/drivers/scsi/ufs/ufs-mediatek.c +++ b/drivers/scsi/ufs/ufs-mediatek.c @@ -677,7 +677,6 @@ static int ufs_mtk_pre_pwr_change(struct ufs_hba *hba, { struct ufs_mtk_host *host = ufshcd_get_variant(hba); struct ufs_dev_params host_cap; - u32 adapt_val; int ret; ufshcd_init_pwr_dev_param(&host_cap); @@ -693,13 +692,9 @@ static int ufs_mtk_pre_pwr_change(struct ufs_hba *hba, } if (host->hw_ver.major >= 3) { - if (dev_req_params->gear_tx == UFS_HS_G4) - adapt_val = PA_INITIAL_ADAPT; - else - adapt_val = PA_NO_ADAPT; - ufshcd_dme_set(hba, - UIC_ARG_MIB(PA_TXHSADAPTTYPE), - adapt_val); + ret = ufshcd_dme_configure_adapt(hba, + dev_req_params->gear_tx, + PA_INITIAL_ADAPT); } return ret; |