UPSTREAM: scsi: ufs-mediatek: Assign arguments with correct type

In ufs_mtk_unipro_set_lpm(), use specific unsigned values as the argument
to invoke ufshcd_dme_set().

At the same time, change the name of ufs_mtk_unipro_set_pm() to
ufs_mtk_unipro_set_lpm() to align the naming convention in MediaTek UFS
driver.

Link: https://lore.kernel.org/r/20201029115750.24391-2-stanley.chu@mediatek.com
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit a004147a33)
Bug: 204438323
Change-Id: I1e75b05fdc8a1204cb5d53fbff0252a2e0432340
Signed-off-by: Bart Van Assche <bvanassche@google.com>
This commit is contained in:
Stanley Chu
2020-10-29 19:57:45 +08:00
committed by Bart Van Assche
parent c098fbf4cf
commit d1f44de521

View File

@@ -755,14 +755,14 @@ static int ufs_mtk_pwr_change_notify(struct ufs_hba *hba,
return ret;
}
static int ufs_mtk_unipro_set_pm(struct ufs_hba *hba, bool lpm)
static int ufs_mtk_unipro_set_lpm(struct ufs_hba *hba, bool lpm)
{
int ret;
struct ufs_mtk_host *host = ufshcd_get_variant(hba);
ret = ufshcd_dme_set(hba,
UIC_ARG_MIB_SEL(VS_UNIPROPOWERDOWNCONTROL, 0),
lpm);
lpm ? 1 : 0);
if (!ret || !lpm) {
/*
* Forcibly set as non-LPM mode if UIC commands is failed
@@ -782,7 +782,7 @@ static int ufs_mtk_pre_link(struct ufs_hba *hba)
ufs_mtk_get_controller_version(hba);
ret = ufs_mtk_unipro_set_pm(hba, false);
ret = ufs_mtk_unipro_set_lpm(hba, false);
if (ret)
return ret;
@@ -897,7 +897,7 @@ static int ufs_mtk_link_set_hpm(struct ufs_hba *hba)
if (err)
return err;
err = ufs_mtk_unipro_set_pm(hba, false);
err = ufs_mtk_unipro_set_lpm(hba, false);
if (err)
return err;
@@ -918,10 +918,10 @@ static int ufs_mtk_link_set_lpm(struct ufs_hba *hba)
{
int err;
err = ufs_mtk_unipro_set_pm(hba, true);
err = ufs_mtk_unipro_set_lpm(hba, true);
if (err) {
/* Resume UniPro state for following error recovery */
ufs_mtk_unipro_set_pm(hba, false);
ufs_mtk_unipro_set_lpm(hba, false);
return err;
}