Commit b058fa86 authored by Stanley Chu's avatar Stanley Chu Committed by Martin K. Petersen
Browse files

scsi: ufs: Remove redundant null checking of devfreq instance

hba->devfreq is zero-initialized thus it is not required to check its
existence in ufshcd_add_lus() function which is invoked during
initialization only.

Link: https://lore.kernel.org/r/20210120150142.5049-3-stanley.chu@mediatek.com


Reviewed-by: default avatarCan Guo <cang@codeaurora.org>
Signed-off-by: default avatarStanley Chu <stanley.chu@mediatek.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent f9a7fa34
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -7768,8 +7768,8 @@ static int ufshcd_add_lus(struct ufs_hba *hba)
			&hba->pwr_info,
			sizeof(struct ufs_pa_layer_attr));
		hba->clk_scaling.saved_pwr_info.is_valid = true;
		if (!hba->devfreq) {
		hba->clk_scaling.is_allowed = true;

		ret = ufshcd_devfreq_init(hba);
		if (ret)
			goto out;
@@ -7777,7 +7777,6 @@ static int ufshcd_add_lus(struct ufs_hba *hba)
		hba->clk_scaling.is_enabled = true;
		ufshcd_init_clk_scaling_sysfs(hba);
	}
	}

	ufs_bsg_probe(hba);
	scsi_scan_host(hba->host);