diff options
author | Bart Van Assche <bvanassche@acm.org> | 2023-05-24 13:36:22 -0700 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2023-05-31 20:35:01 -0400 |
commit | 0818a6903c8081a17da4b1f50ff156537f99b02f (patch) | |
tree | 0b3447dd83fc744715bd45cbc8859b0ad0efb1d8 /drivers/ufs/core | |
parent | b251f6c5fe3b57898896df06a5cf90865596ee5e (diff) | |
download | linux-stable-0818a6903c8081a17da4b1f50ff156537f99b02f.tar.gz linux-stable-0818a6903c8081a17da4b1f50ff156537f99b02f.tar.bz2 linux-stable-0818a6903c8081a17da4b1f50ff156537f99b02f.zip |
scsi: ufs: core: Simplify driver shutdown
All UFS host drivers call ufshcd_shutdown(). Hence, instead of calling
ufshcd_shutdown() from the host driver .shutdown() callback, inline that
function into ufshcd_wl_shutdown().
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-5-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/ufs/core')
-rw-r--r-- | drivers/ufs/core/ufshcd.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index f84af598af33..00f730671f4b 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -9950,9 +9950,7 @@ EXPORT_SYMBOL(ufshcd_runtime_resume); 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); + struct ufs_hba *hba = shost_priv(sdev->host); down(&hba->host_sem); hba->shutting_down = true; @@ -9967,27 +9965,16 @@ static void ufshcd_wl_shutdown(struct device *dev) scsi_device_quiesce(sdev); } __ufshcd_wl_suspend(hba, UFS_SHUTDOWN_PM); -} -/** - * ufshcd_shutdown - shutdown routine - * @hba: per adapter instance - * - * This function would turn off both UFS device and UFS hba - * regulators. It would also disable clocks. - * - * Returns 0 always to allow force shutdown even in case of errors. - */ -int ufshcd_shutdown(struct ufs_hba *hba) -{ + /* + * Next, turn off the UFS controller and the UFS regulators. Disable + * clocks. + */ if (ufshcd_is_ufs_dev_poweroff(hba) && ufshcd_is_link_off(hba)) ufshcd_suspend(hba); hba->is_powered = false; - /* allow force shutdown even in case of errors */ - return 0; } -EXPORT_SYMBOL(ufshcd_shutdown); /** * ufshcd_remove - de-allocate SCSI host and host memory space |