Skip to content

Commit c5977c4

Browse files
ahunter6martinkpetersen
authored andcommitted
scsi: ufs: core: Remove duplicated code in ufshcd_send_bsg_uic_cmd()
Make ufshcd_send_bsg_uic_cmd() call ufshcd_send_uic_cmd() instead of duplicating its code. Signed-off-by: Adrian Hunter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 497027e commit c5977c4

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

drivers/ufs/core/ufshcd.c

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4362,28 +4362,17 @@ int ufshcd_send_bsg_uic_cmd(struct ufs_hba *hba, struct uic_command *uic_cmd)
43624362
{
43634363
int ret;
43644364

4365+
if (uic_cmd->argument1 != UIC_ARG_MIB(PA_PWRMODE) ||
4366+
uic_cmd->command != UIC_CMD_DME_SET)
4367+
return ufshcd_send_uic_cmd(hba, uic_cmd);
4368+
43654369
if (hba->quirks & UFSHCD_QUIRK_BROKEN_UIC_CMD)
43664370
return 0;
43674371

43684372
ufshcd_hold(hba);
4369-
4370-
if (uic_cmd->argument1 == UIC_ARG_MIB(PA_PWRMODE) &&
4371-
uic_cmd->command == UIC_CMD_DME_SET) {
4372-
ret = ufshcd_uic_pwr_ctrl(hba, uic_cmd);
4373-
goto out;
4374-
}
4375-
4376-
mutex_lock(&hba->uic_cmd_mutex);
4377-
ufshcd_add_delay_before_dme_cmd(hba);
4378-
4379-
ret = __ufshcd_send_uic_cmd(hba, uic_cmd);
4380-
if (!ret)
4381-
ret = ufshcd_wait_for_uic_cmd(hba, uic_cmd);
4382-
4383-
mutex_unlock(&hba->uic_cmd_mutex);
4384-
4385-
out:
4373+
ret = ufshcd_uic_pwr_ctrl(hba, uic_cmd);
43864374
ufshcd_release(hba);
4375+
43874376
return ret;
43884377
}
43894378

0 commit comments

Comments
 (0)