mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-08-29 11:42:36 +00:00
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: Bao D. Nguyen <quic_nguyenb@quicinc.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20241016201249.2256266-12-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
72e979225e
commit
b92e5937e3
@ -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",
|
dev_err(hba->dev, "MCQ mode is disabled, err=%d\n",
|
||||||
err);
|
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;
|
if (!is_mcq_supported(hba) && !hba->lsdb_sup) {
|
||||||
} else {
|
|
||||||
if (!hba->lsdb_sup) {
|
|
||||||
dev_err(hba->dev,
|
dev_err(hba->dev,
|
||||||
"%s: failed to initialize (legacy doorbell mode not supported)\n",
|
"%s: failed to initialize (legacy doorbell mode not supported)\n",
|
||||||
__func__);
|
__func__);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = scsi_add_host(hba->host, hba->dev);
|
err = scsi_add_host(hba->host, hba->dev);
|
||||||
if (err) {
|
if (err) {
|
||||||
dev_err(hba->dev, "scsi_add_host failed\n");
|
dev_err(hba->dev, "scsi_add_host failed\n");
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
hba->scsi_host_added = true;
|
hba->scsi_host_added = true;
|
||||||
}
|
|
||||||
|
|
||||||
hba->tmf_tag_set = (struct blk_mq_tag_set) {
|
hba->tmf_tag_set = (struct blk_mq_tag_set) {
|
||||||
.nr_hw_queues = 1,
|
.nr_hw_queues = 1,
|
||||||
|
Loading…
Reference in New Issue
Block a user