linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: ufs: Remove ufshcd_variant_hba_init/exit()
       [not found] <CGME20210806083344epcms2p1fd38026d07cd74438b4aa2bbd95c3f20@epcms2p1>
@ 2021-08-06  8:33 ` Keoseong Park
  0 siblings, 0 replies; only message in thread
From: Keoseong Park @ 2021-08-06  8:33 UTC (permalink / raw)
  To: ALIM AKHTAR, avri.altman, jejb, martin.petersen, cang,
	stanley.chu, beanhuo, jaegeuk, adrian.hunter, asutoshd,
	linux-scsi, linux-kernel

Since hba->vops is checked in ufshcd_vops_init/exit(), there is no
need to check whether hba->vops is NULL in ufshcd_variant_hba_init/exit().

ufshcd_variant_hba_init/exit() has only one caller and only calls vops,
so it was removed.

Signed-off-by: Keoseong Park <keosung.park@samsung.com>
---
 drivers/scsi/ufs/ufshcd.c | 32 ++++++--------------------------
 1 file changed, 6 insertions(+), 26 deletions(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 05495c34a2b7..f1bd074627ff 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -8438,29 +8438,6 @@ static int ufshcd_init_clocks(struct ufs_hba *hba)
 	return ret;
 }
 
-static int ufshcd_variant_hba_init(struct ufs_hba *hba)
-{
-	int err = 0;
-
-	if (!hba->vops)
-		goto out;
-
-	err = ufshcd_vops_init(hba);
-	if (err)
-		dev_err(hba->dev, "%s: variant %s init failed err %d\n",
-			__func__, ufshcd_get_var_name(hba), err);
-out:
-	return err;
-}
-
-static void ufshcd_variant_hba_exit(struct ufs_hba *hba)
-{
-	if (!hba->vops)
-		return;
-
-	ufshcd_vops_exit(hba);
-}
-
 static int ufshcd_hba_init(struct ufs_hba *hba)
 {
 	int err;
@@ -8496,9 +8473,12 @@ static int ufshcd_hba_init(struct ufs_hba *hba)
 	if (err)
 		goto out_disable_clks;
 
-	err = ufshcd_variant_hba_init(hba);
-	if (err)
+	err = ufshcd_vops_init(hba);
+	if (err) {
+		dev_err(hba->dev, "%s: variant %s init failed err %d\n",
+			__func__, ufshcd_get_var_name(hba), err);
 		goto out_disable_vreg;
+	}
 
 	ufs_debugfs_hba_init(hba);
 
@@ -8523,7 +8503,7 @@ static void ufshcd_hba_exit(struct ufs_hba *hba)
 		if (hba->eh_wq)
 			destroy_workqueue(hba->eh_wq);
 		ufs_debugfs_hba_exit(hba);
-		ufshcd_variant_hba_exit(hba);
+		ufshcd_vops_exit(hba);
 		ufshcd_setup_vreg(hba, false);
 		ufshcd_setup_clocks(hba, false);
 		ufshcd_setup_hba_vreg(hba, false);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-06  8:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20210806083344epcms2p1fd38026d07cd74438b4aa2bbd95c3f20@epcms2p1>
2021-08-06  8:33 ` [PATCH] scsi: ufs: Remove ufshcd_variant_hba_init/exit() Keoseong Park

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).