aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanley Chu2021-01-20 23:01:41 +0800
committerMartin K. Petersen2021-01-20 22:29:38 -0500
commitb058fa868234fe835af4e3887b4f0d018a9220ed (patch)
tree6e4bf6649c8b6e4823d96e9af0e3843dd4f0e536
parentf9a7fa345aec28bc1c15a55572e016bbeb5f4254 (diff)
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: Can Guo <cang@codeaurora.org> Signed-off-by: Stanley Chu <stanley.chu@mediatek.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--drivers/scsi/ufs/ufshcd.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index d6cd30ccf908..b1b69207ca17 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -7768,15 +7768,14 @@ 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;
+ hba->clk_scaling.is_allowed = true;
- hba->clk_scaling.is_enabled = true;
- ufshcd_init_clk_scaling_sysfs(hba);
- }
+ ret = ufshcd_devfreq_init(hba);
+ if (ret)
+ goto out;
+
+ hba->clk_scaling.is_enabled = true;
+ ufshcd_init_clk_scaling_sysfs(hba);
}
ufs_bsg_probe(hba);