@@ -1260,7 +1260,8 @@ static int ufshcd_devfreq_scale(struct ufs_hba *hba, bool scale_up)
/* Enable Write Booster if we have scaled up else disable it */
downgrade_write(&hba->clk_scaling_lock);
is_writelock = false;
- ufshcd_wb_toggle(hba, scale_up);
+ if (ufshcd_is_wb_allowed(hba))
+ ufshcd_wb_toggle(hba, scale_up);
out_unprepare:
ufshcd_clock_scaling_unprepare(hba, is_writelock);
@@ -5438,9 +5439,6 @@ int ufshcd_wb_toggle(struct ufs_hba *hba, bool enable)
{
int ret;
- if (!ufshcd_is_wb_allowed(hba))
- return 0;
-
if (!(enable ^ hba->dev_info.wb_enabled))
return 0;
@@ -5477,8 +5475,7 @@ static inline void ufshcd_wb_toggle_flush(struct ufs_hba *hba, bool enable)
{
int ret;
- if (!ufshcd_is_wb_allowed(hba) ||
- hba->dev_info.wb_buf_flush_enabled == enable)
+ if (hba->dev_info.wb_buf_flush_enabled == enable)
return;
ret = __ufshcd_wb_toggle(hba, enable, QUERY_FLAG_IDN_WB_BUFF_FLUSH_EN);