All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keoseong Park <keosung.park@samsung.com>
To: ALIM AKHTAR <alim.akhtar@samsung.com>,
	"avri.altman@wdc.com" <avri.altman@wdc.com>,
	"jejb@linux.ibm.com" <jejb@linux.ibm.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	"cang@codeaurora.org" <cang@codeaurora.org>,
	"stanley.chu@mediatek.com" <stanley.chu@mediatek.com>,
	"beanhuo@micron.com" <beanhuo@micron.com>,
	"jaegeuk@kernel.org" <jaegeuk@kernel.org>,
	"adrian.hunter@intel.com" <adrian.hunter@intel.com>,
	"asutoshd@codeaurora.org" <asutoshd@codeaurora.org>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH] scsi: ufs: Remove ufshcd_variant_hba_init/exit()
Date: Fri, 06 Aug 2021 17:33:44 +0900	[thread overview]
Message-ID: <1891546521.01628240102206.JavaMail.epsvc@epcpadp3> (raw)
In-Reply-To: CGME20210806083344epcms2p1fd38026d07cd74438b4aa2bbd95c3f20@epcms2p1

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

           reply	other threads:[~2021-08-06  8:55 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <CGME20210806083344epcms2p1fd38026d07cd74438b4aa2bbd95c3f20@epcms2p1>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1891546521.01628240102206.JavaMail.epsvc@epcpadp3 \
    --to=keosung.park@samsung.com \
    --cc=adrian.hunter@intel.com \
    --cc=alim.akhtar@samsung.com \
    --cc=asutoshd@codeaurora.org \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=cang@codeaurora.org \
    --cc=jaegeuk@kernel.org \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=stanley.chu@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.