Skip to content

Commit b251f6c

Browse files
bvanasschemartinkpetersen
authored andcommitted
scsi: ufs: core: Move ufshcd_wl_shutdown()
Move the definition of ufshcd_wl_shutdown() to make the next patch in this series easier to review. Reviewed-by: Adrian Hunter <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 549e91a commit b251f6c

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

drivers/ufs/core/ufshcd.c

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9763,28 +9763,6 @@ static int ufshcd_wl_resume(struct device *dev)
97639763
}
97649764
#endif
97659765

9766-
static void ufshcd_wl_shutdown(struct device *dev)
9767-
{
9768-
struct scsi_device *sdev = to_scsi_device(dev);
9769-
struct ufs_hba *hba;
9770-
9771-
hba = shost_priv(sdev->host);
9772-
9773-
down(&hba->host_sem);
9774-
hba->shutting_down = true;
9775-
up(&hba->host_sem);
9776-
9777-
/* Turn on everything while shutting down */
9778-
ufshcd_rpm_get_sync(hba);
9779-
scsi_device_quiesce(sdev);
9780-
shost_for_each_device(sdev, hba->host) {
9781-
if (sdev == hba->ufs_device_wlun)
9782-
continue;
9783-
scsi_device_quiesce(sdev);
9784-
}
9785-
__ufshcd_wl_suspend(hba, UFS_SHUTDOWN_PM);
9786-
}
9787-
97889766
/**
97899767
* ufshcd_suspend - helper function for suspend operations
97909768
* @hba: per adapter instance
@@ -9969,6 +9947,28 @@ int ufshcd_runtime_resume(struct device *dev)
99699947
EXPORT_SYMBOL(ufshcd_runtime_resume);
99709948
#endif /* CONFIG_PM */
99719949

9950+
static void ufshcd_wl_shutdown(struct device *dev)
9951+
{
9952+
struct scsi_device *sdev = to_scsi_device(dev);
9953+
struct ufs_hba *hba;
9954+
9955+
hba = shost_priv(sdev->host);
9956+
9957+
down(&hba->host_sem);
9958+
hba->shutting_down = true;
9959+
up(&hba->host_sem);
9960+
9961+
/* Turn on everything while shutting down */
9962+
ufshcd_rpm_get_sync(hba);
9963+
scsi_device_quiesce(sdev);
9964+
shost_for_each_device(sdev, hba->host) {
9965+
if (sdev == hba->ufs_device_wlun)
9966+
continue;
9967+
scsi_device_quiesce(sdev);
9968+
}
9969+
__ufshcd_wl_suspend(hba, UFS_SHUTDOWN_PM);
9970+
}
9971+
99729972
/**
99739973
* ufshcd_shutdown - shutdown routine
99749974
* @hba: per adapter instance

0 commit comments

Comments
 (0)