summaryrefslogtreecommitdiff
path: root/drivers/ufs/core/ufshcd.c
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2024-10-16 13:12:05 -0700
committerMartin K. Petersen <martin.petersen@oracle.com>2024-10-25 15:30:21 -0400
commitb6195d02b914ddfddb50e3ceb6b66928ebf0fdb8 (patch)
tree51b46a6ac7c9aad6b523577e051de3e750ad8b54 /drivers/ufs/core/ufshcd.c
parenta390e6677f4119e3b9e6364ac2c5cbe3ef1321a2 (diff)
downloadlwn-b6195d02b914ddfddb50e3ceb6b66928ebf0fdb8.tar.gz
lwn-b6195d02b914ddfddb50e3ceb6b66928ebf0fdb8.zip
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>
Diffstat (limited to 'drivers/ufs/core/ufshcd.c')
-rw-r--r--drivers/ufs/core/ufshcd.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 239e826f4b49..4103b1c9c388 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -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);
}