Skip to content

Commit 0600eec

Browse files
Chanwoo Leemartinkpetersen
authored andcommitted
scsi: ufs: Remove redundant vops NULL check and trivial wrapper
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> Reviewed-by: Peter Wang <peter.wang@mediatek.com> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Link: https://patch.msgid.link/20260529061623.301291-1-cw9316.lee@samsung.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 6bfc4bf commit 0600eec

1 file changed

Lines changed: 2 additions & 15 deletions

File tree

drivers/ufs/core/ufshcd.c

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9854,28 +9854,15 @@ static int ufshcd_init_clocks(struct ufs_hba *hba)
98549854

98559855
static int ufshcd_variant_hba_init(struct ufs_hba *hba)
98569856
{
9857-
int err = 0;
9858-
9859-
if (!hba->vops)
9860-
goto out;
9857+
int err = ufshcd_vops_init(hba);
98619858

9862-
err = ufshcd_vops_init(hba);
98639859
if (err)
98649860
dev_err_probe(hba->dev, err,
98659861
"%s: variant %s init failed with err %d\n",
98669862
__func__, ufshcd_get_var_name(hba), err);
9867-
out:
98689863
return err;
98699864
}
98709865

9871-
static void ufshcd_variant_hba_exit(struct ufs_hba *hba)
9872-
{
9873-
if (!hba->vops)
9874-
return;
9875-
9876-
ufshcd_vops_exit(hba);
9877-
}
9878-
98799866
static int ufshcd_hba_init(struct ufs_hba *hba)
98809867
{
98819868
int err;
@@ -9943,7 +9930,7 @@ static void ufshcd_hba_exit(struct ufs_hba *hba)
99439930
if (hba->eh_wq)
99449931
destroy_workqueue(hba->eh_wq);
99459932
ufs_debugfs_hba_exit(hba);
9946-
ufshcd_variant_hba_exit(hba);
9933+
ufshcd_vops_exit(hba);
99479934
ufshcd_setup_vreg(hba, false);
99489935
ufshcd_setup_clocks(hba, false);
99499936
ufshcd_setup_hba_vreg(hba, false);

0 commit comments

Comments
 (0)