scsi: ufs: core: Remove code that is no longer needed
Previous changes guarantee that hba->scsi_host_added is true before ufshcd_device_init() is called. Hence, remove the code from ufshcd_device_init() that depends on hba->scsi_host_added being false. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20241016201249.2256266-10-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
committed by
Martin K. Petersen
parent
a390e6677f
commit
b6195d02b9
@@ -8753,7 +8753,8 @@ static int ufshcd_post_device_init(struct ufs_hba *hba)
|
||||
static int ufshcd_device_init(struct ufs_hba *hba, bool init_dev_params)
|
||||
{
|
||||
int ret;
|
||||
struct Scsi_Host *host = hba->host;
|
||||
|
||||
WARN_ON_ONCE(!hba->scsi_host_added);
|
||||
|
||||
hba->ufshcd_state = UFSHCD_STATE_RESET;
|
||||
|
||||
@@ -8794,27 +8795,8 @@ static int ufshcd_device_init(struct ufs_hba *hba, bool init_dev_params)
|
||||
ret = ufshcd_device_params_init(hba);
|
||||
if (ret)
|
||||
return ret;
|
||||
if (is_mcq_supported(hba) && !hba->scsi_host_added) {
|
||||
ufshcd_mcq_enable(hba);
|
||||
ret = ufshcd_alloc_mcq(hba);
|
||||
if (!ret) {
|
||||
ufshcd_config_mcq(hba);
|
||||
} else {
|
||||
/* Continue with SDB mode */
|
||||
ufshcd_mcq_disable(hba);
|
||||
use_mcq_mode = false;
|
||||
dev_err(hba->dev, "MCQ mode is disabled, err=%d\n",
|
||||
ret);
|
||||
}
|
||||
ret = scsi_add_host(host, hba->dev);
|
||||
if (ret) {
|
||||
dev_err(hba->dev, "scsi_add_host failed\n");
|
||||
return ret;
|
||||
}
|
||||
hba->scsi_host_added = true;
|
||||
} else if (is_mcq_supported(hba) &&
|
||||
hba->quirks &
|
||||
UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH) {
|
||||
if (is_mcq_supported(hba) &&
|
||||
hba->quirks & UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH) {
|
||||
ufshcd_config_mcq(hba);
|
||||
ufshcd_mcq_enable(hba);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user