From: Chanwoo Lee <cw9316.lee@samsung.com>
To: Alim Akhtar <alim.akhtar@samsung.com>,
Avri Altman <avri.altman@wdc.com>,
Bart Van Assche <bvanassche@acm.org>,
"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Peter Wang <peter.wang@mediatek.com>,
Bean Huo <beanhuo@micron.com>, Can Guo <can.guo@oss.qualcomm.com>,
Adrian Hunter <adrian.hunter@intel.com>,
linux-scsi@vger.kernel.org (open list:UNIVERSAL FLASH STORAGE
HOST CONTROLLER DRIVER), linux-kernel@vger.kernel.org (open list)
Cc: Chanwoo Lee <cw9316.lee@samsung.com>
Subject: [PATCH] scsi: ufs: Remove redundant vops NULL check and trivial wrapper
Date: Fri, 29 May 2026 15:16:19 +0900 [thread overview]
Message-ID: <20260529061623.301291-1-cw9316.lee@samsung.com> (raw)
In-Reply-To: <CGME20260529061727epcas1p495c499c91420790a225e66263f3fff52@epcas1p4.samsung.com>
ufshcd_variant_hba_init/exit() check 'if (!hba->vops)' before
calling vops wrappers, but the wrappers already do NULL check
internally. Remove the redundant checks. Also remove
ufshcd_variant_hba_exit() entirely since it only wraps
ufshcd_vops_exit() with no added value.
Signed-off-by: Chanwoo Lee <cw9316.lee@samsung.com>
---
drivers/ufs/core/ufshcd.c | 17 ++---------------
1 file changed, 2 insertions(+), 15 deletions(-)
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 7481c71c71b8..1f914d095adb 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -9870,28 +9870,15 @@ static int ufshcd_init_clocks(struct ufs_hba *hba)
static int ufshcd_variant_hba_init(struct ufs_hba *hba)
{
- int err = 0;
-
- if (!hba->vops)
- goto out;
+ int err = ufshcd_vops_init(hba);
- err = ufshcd_vops_init(hba);
if (err)
dev_err_probe(hba->dev, err,
"%s: variant %s init failed with 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;
@@ -9959,7 +9946,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.43.0
next parent reply other threads:[~2026-05-29 6:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20260529061727epcas1p495c499c91420790a225e66263f3fff52@epcas1p4.samsung.com>
2026-05-29 6:16 ` Chanwoo Lee [this message]
2026-05-29 9:08 ` Peter Wang (王信友)
2026-05-29 17:36 ` Bart Van Assche
2026-06-02 2:02 ` Martin K. Petersen
2026-06-09 1:38 ` Martin K. Petersen
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=20260529061623.301291-1-cw9316.lee@samsung.com \
--to=cw9316.lee@samsung.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=adrian.hunter@intel.com \
--cc=alim.akhtar@samsung.com \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=can.guo@oss.qualcomm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=peter.wang@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®