From: Chanwoo Lee Date: Fri, 29 May 2026 06:16:19 +0000 (+0900) Subject: scsi: ufs: Remove redundant vops NULL check and trivial wrapper X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0600eec09ad6cc5ba3ca78aceb6fa8dcbad010bb;p=thirdparty%2Flinux.git 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 Reviewed-by: Peter Wang Reviewed-by: Bart Van Assche Link: https://patch.msgid.link/20260529061623.301291-1-cw9316.lee@samsung.com Signed-off-by: Martin K. Petersen --- diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index 3441e874eacc..60ec2c63c2d8 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -9854,28 +9854,15 @@ out: 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; @@ -9943,7 +9930,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);