Skip to content

Commit b6195d0

Browse files
bvanasschemartinkpetersen
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent a390e66 commit b6195d0

File tree

1 file changed

+4
-22
lines changed

1 file changed

+4
-22
lines changed

drivers/ufs/core/ufshcd.c

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8753,7 +8753,8 @@ static int ufshcd_post_device_init(struct ufs_hba *hba)
87538753
static int ufshcd_device_init(struct ufs_hba *hba, bool init_dev_params)
87548754
{
87558755
int ret;
8756-
struct Scsi_Host *host = hba->host;
8756+
8757+
WARN_ON_ONCE(!hba->scsi_host_added);
87578758

87588759
hba->ufshcd_state = UFSHCD_STATE_RESET;
87598760

@@ -8794,27 +8795,8 @@ static int ufshcd_device_init(struct ufs_hba *hba, bool init_dev_params)
87948795
ret = ufshcd_device_params_init(hba);
87958796
if (ret)
87968797
return ret;
8797-
if (is_mcq_supported(hba) && !hba->scsi_host_added) {
8798-
ufshcd_mcq_enable(hba);
8799-
ret = ufshcd_alloc_mcq(hba);
8800-
if (!ret) {
8801-
ufshcd_config_mcq(hba);
8802-
} else {
8803-
/* Continue with SDB mode */
8804-
ufshcd_mcq_disable(hba);
8805-
use_mcq_mode = false;
8806-
dev_err(hba->dev, "MCQ mode is disabled, err=%d\n",
8807-
ret);
8808-
}
8809-
ret = scsi_add_host(host, hba->dev);
8810-
if (ret) {
8811-
dev_err(hba->dev, "scsi_add_host failed\n");
8812-
return ret;
8813-
}
8814-
hba->scsi_host_added = true;
8815-
} else if (is_mcq_supported(hba) &&
8816-
hba->quirks &
8817-
UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH) {
8798+
if (is_mcq_supported(hba) &&
8799+
hba->quirks & UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH) {
88188800
ufshcd_config_mcq(hba);
88198801
ufshcd_mcq_enable(hba);
88208802
}

0 commit comments

Comments
 (0)