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 <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20250723165856.145750-6-adrian.hunter@intel.com
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
Adrian Hunter 2025-07-23 19:58:53 +03:00 committed by Martin K. Petersen
parent 497027eade
commit c5977c4c07

View File

@ -4362,28 +4362,17 @@ int ufshcd_send_bsg_uic_cmd(struct ufs_hba *hba, struct uic_command *uic_cmd)
{
int ret;
if (uic_cmd->argument1 != UIC_ARG_MIB(PA_PWRMODE) ||
uic_cmd->command != UIC_CMD_DME_SET)
return ufshcd_send_uic_cmd(hba, uic_cmd);
if (hba->quirks & UFSHCD_QUIRK_BROKEN_UIC_CMD)
return 0;
ufshcd_hold(hba);
if (uic_cmd->argument1 == UIC_ARG_MIB(PA_PWRMODE) &&
uic_cmd->command == UIC_CMD_DME_SET) {
ret = ufshcd_uic_pwr_ctrl(hba, uic_cmd);
goto out;
}
mutex_lock(&hba->uic_cmd_mutex);
ufshcd_add_delay_before_dme_cmd(hba);
ret = __ufshcd_send_uic_cmd(hba, uic_cmd);
if (!ret)
ret = ufshcd_wait_for_uic_cmd(hba, uic_cmd);
mutex_unlock(&hba->uic_cmd_mutex);
out:
ret = ufshcd_uic_pwr_ctrl(hba, uic_cmd);
ufshcd_release(hba);
return ret;
}