summaryrefslogtreecommitdiff
path: root/drivers/scsi/ufs/ufs-sysfs.c
diff options
context:
space:
mode:
authorYue Hu <huyue2@yulong.com>2021-03-18 12:55:36 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2021-03-19 05:33:48 +0300
commit3b5f3c0d0548b8d963030b8728e380d6d57aa471 (patch)
tree576e70cd24fd3ab3f14767890d4dd33fb7a0e51e /drivers/scsi/ufs/ufs-sysfs.c
parent69a1709e2ec84b3846327d34d0749a6f2e7803dd (diff)
downloadlinux-3b5f3c0d0548b8d963030b8728e380d6d57aa471.tar.xz
scsi: ufs: core: Tidy up WB configuration code
There are similar code implementations for WB configuration in ufshcd_wb_{ctrl, toggle_flush_during_h8, toggle_flush}. Extract the common parts to create a new helper with a flag parameter to reduce code duplication. Meanwhile, rename ufshcd_wb_ctrl() to ufshcd_wb_toggle() for better readability. And remove unnecessary log messages from ufshcd_wb_config() since relevant toggle function will emit messages. Also change ufshcd_wb_toggle_flush{__during_h8} to void type accordingly. Link: https://lore.kernel.org/r/20210318095536.2048-1-zbestahu@gmail.com Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Yue Hu <huyue2@yulong.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/ufs/ufs-sysfs.c')
-rw-r--r--drivers/scsi/ufs/ufs-sysfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/ufs/ufs-sysfs.c b/drivers/scsi/ufs/ufs-sysfs.c
index acc54f530f2d..d7c3cff9662f 100644
--- a/drivers/scsi/ufs/ufs-sysfs.c
+++ b/drivers/scsi/ufs/ufs-sysfs.c
@@ -246,7 +246,7 @@ static ssize_t wb_on_store(struct device *dev, struct device_attribute *attr,
}
pm_runtime_get_sync(hba->dev);
- res = ufshcd_wb_ctrl(hba, wb_enable);
+ res = ufshcd_wb_toggle(hba, wb_enable);
pm_runtime_put_sync(hba->dev);
out:
up(&hba->host_sem);