scsi: ufs: core: Move ufshcd_wl_shutdown()
authorBart Van Assche <bvanassche@acm.org>
Wed, 24 May 2023 20:36:21 +0000 (13:36 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 1 Jun 2023 00:35:01 +0000 (20:35 -0400)
Move the definition of ufshcd_wl_shutdown() to make the next patch in this
series easier to review.

Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20230524203659.1394307-4-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/ufs/core/ufshcd.c

index 55c58bf..f84af59 100644 (file)
@@ -9763,28 +9763,6 @@ out:
 }
 #endif
 
-static void ufshcd_wl_shutdown(struct device *dev)
-{
-       struct scsi_device *sdev = to_scsi_device(dev);
-       struct ufs_hba *hba;
-
-       hba = shost_priv(sdev->host);
-
-       down(&hba->host_sem);
-       hba->shutting_down = true;
-       up(&hba->host_sem);
-
-       /* Turn on everything while shutting down */
-       ufshcd_rpm_get_sync(hba);
-       scsi_device_quiesce(sdev);
-       shost_for_each_device(sdev, hba->host) {
-               if (sdev == hba->ufs_device_wlun)
-                       continue;
-               scsi_device_quiesce(sdev);
-       }
-       __ufshcd_wl_suspend(hba, UFS_SHUTDOWN_PM);
-}
-
 /**
  * ufshcd_suspend - helper function for suspend operations
  * @hba: per adapter instance
@@ -9969,6 +9947,28 @@ int ufshcd_runtime_resume(struct device *dev)
 EXPORT_SYMBOL(ufshcd_runtime_resume);
 #endif /* CONFIG_PM */
 
+static void ufshcd_wl_shutdown(struct device *dev)
+{
+       struct scsi_device *sdev = to_scsi_device(dev);
+       struct ufs_hba *hba;
+
+       hba = shost_priv(sdev->host);
+
+       down(&hba->host_sem);
+       hba->shutting_down = true;
+       up(&hba->host_sem);
+
+       /* Turn on everything while shutting down */
+       ufshcd_rpm_get_sync(hba);
+       scsi_device_quiesce(sdev);
+       shost_for_each_device(sdev, hba->host) {
+               if (sdev == hba->ufs_device_wlun)
+                       continue;
+               scsi_device_quiesce(sdev);
+       }
+       __ufshcd_wl_suspend(hba, UFS_SHUTDOWN_PM);
+}
+
 /**
  * ufshcd_shutdown - shutdown routine
  * @hba: per adapter instance