Commit a004147a authored by Stanley Chu's avatar Stanley Chu Committed by Martin K. Petersen

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.comSigned-off-by: default avatarStanley Chu <stanley.chu@mediatek.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 0d882320
...@@ -639,14 +639,14 @@ static int ufs_mtk_pwr_change_notify(struct ufs_hba *hba, ...@@ -639,14 +639,14 @@ static int ufs_mtk_pwr_change_notify(struct ufs_hba *hba,
return ret; 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; int ret;
struct ufs_mtk_host *host = ufshcd_get_variant(hba); struct ufs_mtk_host *host = ufshcd_get_variant(hba);
ret = ufshcd_dme_set(hba, ret = ufshcd_dme_set(hba,
UIC_ARG_MIB_SEL(VS_UNIPROPOWERDOWNCONTROL, 0), UIC_ARG_MIB_SEL(VS_UNIPROPOWERDOWNCONTROL, 0),
lpm); lpm ? 1 : 0);
if (!ret || !lpm) { if (!ret || !lpm) {
/* /*
* Forcibly set as non-LPM mode if UIC commands is failed * Forcibly set as non-LPM mode if UIC commands is failed
...@@ -664,7 +664,7 @@ static int ufs_mtk_pre_link(struct ufs_hba *hba) ...@@ -664,7 +664,7 @@ static int ufs_mtk_pre_link(struct ufs_hba *hba)
int ret; int ret;
u32 tmp; u32 tmp;
ret = ufs_mtk_unipro_set_pm(hba, false); ret = ufs_mtk_unipro_set_lpm(hba, false);
if (ret) if (ret)
return ret; return ret;
...@@ -776,7 +776,7 @@ static int ufs_mtk_link_set_hpm(struct ufs_hba *hba) ...@@ -776,7 +776,7 @@ static int ufs_mtk_link_set_hpm(struct ufs_hba *hba)
if (err) if (err)
return err; return err;
err = ufs_mtk_unipro_set_pm(hba, false); err = ufs_mtk_unipro_set_lpm(hba, false);
if (err) if (err)
return err; return err;
...@@ -797,10 +797,10 @@ static int ufs_mtk_link_set_lpm(struct ufs_hba *hba) ...@@ -797,10 +797,10 @@ static int ufs_mtk_link_set_lpm(struct ufs_hba *hba)
{ {
int err; int err;
err = ufs_mtk_unipro_set_pm(hba, true); err = ufs_mtk_unipro_set_lpm(hba, true);
if (err) { if (err) {
/* Resume UniPro state for following error recovery */ /* Resume UniPro state for following error recovery */
ufs_mtk_unipro_set_pm(hba, false); ufs_mtk_unipro_set_lpm(hba, false);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment