[PATCH v10 2/4] scsi: ufs: core: Add a helper for the system suspend callbacks
From: HOYOUNG SEO
Date: Wed Nov 11 2026 - 04:08:39 EST
Move the body of ufshcd_wl_suspend() into ufshcd_wl_system_suspend(),
which takes the PM operation as a parameter, so that it can be shared
with ufshcd_wl_poweroff() in the next patch. ufshcd_wl_suspend() calls it
with UFS_SYSTEM_PM.
No functional change, except that the error message printed when the
suspend fails now contains the name of the new function.
Suggested-by: Bart Van Assche <bvanassche@xxxxxxx>
Signed-off-by: HOYOUNG SEO <hy50.seo@xxxxxxxxxxx>
---
drivers/ufs/core/ufshcd.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 3b5580ac390c..4825349e87fd 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -10712,7 +10712,7 @@ static int ufshcd_wl_runtime_resume(struct device *dev)
#endif
#ifdef CONFIG_PM_SLEEP
-static int ufshcd_wl_suspend(struct device *dev)
+static int ufshcd_wl_system_suspend(struct device *dev, enum ufs_pm_op pm_op)
{
struct scsi_device *sdev = to_scsi_device(dev);
struct ufs_hba *hba;
@@ -10725,7 +10725,7 @@ static int ufshcd_wl_suspend(struct device *dev)
if (pm_runtime_suspended(dev))
goto out;
- ret = __ufshcd_wl_suspend(hba, UFS_SYSTEM_PM);
+ ret = __ufshcd_wl_suspend(hba, pm_op);
if (ret) {
dev_err(&sdev->sdev_gendev, "%s failed: %d\n", __func__, ret);
up(&hba->host_sem);
@@ -10741,6 +10741,11 @@ static int ufshcd_wl_suspend(struct device *dev)
return ret;
}
+static int ufshcd_wl_suspend(struct device *dev)
+{
+ return ufshcd_wl_system_suspend(dev, UFS_SYSTEM_PM);
+}
+
static int ufshcd_wl_resume(struct device *dev)
{
struct scsi_device *sdev = to_scsi_device(dev);
--
2.34.1