Message ID | 20230517223157.1068210-4-bvanassche@acm.org |
---|---|
State | Superseded |
Headers | show |
Series | None | expand |
On 18/05/23 01:31, Bart Van Assche wrote: > Move the definition of ufshcd_wl_shutdown() to make the next patch in > this series easier to review. > > Signed-off-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Adrian Hunter <adrian.hunter@intel.com> > --- > drivers/ufs/core/ufshcd.c | 44 +++++++++++++++++++-------------------- > 1 file changed, 22 insertions(+), 22 deletions(-) > > diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c > index 68d9e24fac98..0f426d46d91e 100644 > --- a/drivers/ufs/core/ufshcd.c > +++ b/drivers/ufs/core/ufshcd.c > @@ -9746,28 +9746,6 @@ static int ufshcd_wl_resume(struct device *dev) > } > #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 > @@ -9952,6 +9930,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 >
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 68d9e24fac98..0f426d46d91e 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -9746,28 +9746,6 @@ static int ufshcd_wl_resume(struct device *dev) } #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 @@ -9952,6 +9930,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
Move the definition of ufshcd_wl_shutdown() to make the next patch in this series easier to review. Signed-off-by: Bart Van Assche <bvanassche@acm.org> --- drivers/ufs/core/ufshcd.c | 44 +++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 22 deletions(-)