Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Bart Van Assche and committed by
Martin K. Petersen
b6195d02 a390e667

+4 -22
+4 -22
drivers/ufs/core/ufshcd.c
··· 8753 8753 static int ufshcd_device_init(struct ufs_hba *hba, bool init_dev_params) 8754 8754 { 8755 8755 int ret; 8756 - struct Scsi_Host *host = hba->host; 8756 + 8757 + WARN_ON_ONCE(!hba->scsi_host_added); 8757 8758 8758 8759 hba->ufshcd_state = UFSHCD_STATE_RESET; 8759 8760 ··· 8795 8794 ret = ufshcd_device_params_init(hba); 8796 8795 if (ret) 8797 8796 return ret; 8798 - if (is_mcq_supported(hba) && !hba->scsi_host_added) { 8799 - ufshcd_mcq_enable(hba); 8800 - ret = ufshcd_alloc_mcq(hba); 8801 - if (!ret) { 8802 - ufshcd_config_mcq(hba); 8803 - } else { 8804 - /* Continue with SDB mode */ 8805 - ufshcd_mcq_disable(hba); 8806 - use_mcq_mode = false; 8807 - dev_err(hba->dev, "MCQ mode is disabled, err=%d\n", 8808 - ret); 8809 - } 8810 - ret = scsi_add_host(host, hba->dev); 8811 - if (ret) { 8812 - dev_err(hba->dev, "scsi_add_host failed\n"); 8813 - return ret; 8814 - } 8815 - hba->scsi_host_added = true; 8816 - } else if (is_mcq_supported(hba) && 8817 - hba->quirks & 8818 - UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH) { 8797 + if (is_mcq_supported(hba) && 8798 + hba->quirks & UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH) { 8819 8799 ufshcd_config_mcq(hba); 8820 8800 ufshcd_mcq_enable(hba); 8821 8801 }