Commit b92e5937 authored by Bart Van Assche's avatar Bart Van Assche Committed by Martin K. Petersen
Browse files

scsi: ufs: core: Move code out of an if-statement



The previous patch in this series introduced identical code in both
branches of an if-statement. Move that code outside the if-statement.

Reviewed-by: default avatarBao D. Nguyen <quic_nguyenb@quicinc.com>
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20241016201249.2256266-12-bvanassche@acm.org


Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 72e97922
Loading
Loading
Loading
Loading
+13 −19
Original line number Diff line number Diff line
@@ -10356,26 +10356,20 @@ static int ufshcd_add_scsi_host(struct ufs_hba *hba)
			dev_err(hba->dev, "MCQ mode is disabled, err=%d\n",
				err);
		}
		err = scsi_add_host(hba->host, hba->dev);
		if (err) {
			dev_err(hba->dev, "scsi_add_host failed\n");
			return err;
	}
		hba->scsi_host_added = true;
	} else {
		if (!hba->lsdb_sup) {
	if (!is_mcq_supported(hba) && !hba->lsdb_sup) {
		dev_err(hba->dev,
			"%s: failed to initialize (legacy doorbell mode not supported)\n",
			__func__);
		return -EINVAL;
	}

	err = scsi_add_host(hba->host, hba->dev);
	if (err) {
		dev_err(hba->dev, "scsi_add_host failed\n");
		return err;
	}
	hba->scsi_host_added = true;
	}

	hba->tmf_tag_set = (struct blk_mq_tag_set) {
		.nr_hw_queues	= 1,