diff mbox series

[v6,05/11] scsi: ufs: core: Convert a comment into an explicit check

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

Commit Message

Bart Van Assche Oct. 16, 2024, 8:12 p.m. UTC
The comment /* UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH is set */ is
only correct if ufshcd_device_init() is only called by ufshcd_probe_hba().
Convert the comment into an explicit check. This patch prepares for moving
the ufshcd_device_init() calls.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/ufs/core/ufshcd.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 724060a9eae7..7b8eaf2b9ce2 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -8851,8 +8851,9 @@  static int ufshcd_device_init(struct ufs_hba *hba, bool init_dev_params)
 				return ret;
 			}
 			hba->scsi_host_added = true;
-		} else if (is_mcq_supported(hba)) {
-			/* UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH is set */
+		} else if (is_mcq_supported(hba) &&
+			   hba->quirks &
+				   UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH) {
 			ufshcd_config_mcq(hba);
 			ufshcd_mcq_enable(hba);
 		}