down(&hba->host_sem);
/* Initialize hba, detect and initialize UFS device */
probe_start = ktime_get();
- ret = ufshcd_device_init(hba, /*init_dev_params=*/true);
- if (ret == 0)
- ret = ufshcd_probe_hba(hba, true);
+ ret = ufshcd_probe_hba(hba, true);
ufshcd_process_probe_result(hba, probe_start, ret);
up(&hba->host_sem);
if (ret)
{
int err;
- if (!is_mcq_supported(hba)) {
+ if (!hba->scsi_host_added) {
+ WARN_ON_ONCE(is_mcq_supported(hba));
if (!hba->lsdb_sup) {
dev_err(hba->dev,
"%s: failed to initialize (legacy doorbell mode not supported)\n",
*/
ufshcd_set_ufs_dev_active(hba);
+ /* Initialize hba, detect and initialize UFS device */
+ err = ufshcd_device_init(hba, /*init_dev_params=*/true);
+ if (err)
+ goto out_disable;
+
err = ufshcd_add_scsi_host(hba);
if (err)
goto out_disable;