diff mbox series

[v5,10/10] scsi: ufs: core: Move code out of an if-statement

Message ID 20240910215139.3352387-11-bvanassche@acm.org
State New
Headers show
Series Combine the UFS driver scsi_add_host() calls | expand

Commit Message

Bart Van Assche Sept. 10, 2024, 9:50 p.m. UTC
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>
---
 drivers/ufs/core/ufshcd.c | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)
diff mbox series

Patch

diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 8e4e25da9a6f..2ad2c3e968c4 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -10378,21 +10378,15 @@  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 {
-		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;
 	}
 
+	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,
 		.queue_depth	= hba->nutmrs,