aboutsummaryrefslogtreecommitdiff
path: root/drivers/ufs
diff options
context:
space:
mode:
authorKeoseong Park2023-05-03 19:46:30 +0900
committerMartin K. Petersen2023-05-22 17:26:09 -0400
commita1f871f9f30124669d7afbdb8754f0826f49b564 (patch)
tree9d7cfd372bbfee63bee244bd0d38591e54fb7593 /drivers/ufs
parent8b60e2189fcd8b10b592608256eb97aebfcff147 (diff)
scsi: ufs: core: Return earlier if ufshcd_hba_init_crypto_capabilities() fails
The 'err' variable is used only as the result of ufshcd_hba_init_crypto_capabilities(), so return 'err' immediately when failed. If it is not an error, explicitly return 0. Signed-off-by: Keoseong Park <keosung.park@samsung.com> Link: https://lore.kernel.org/r/20230503104630epcms2p8b82734102ffb920531e9264604086372@epcms2p8 Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/ufs')
-rw-r--r--drivers/ufs/core/ufshcd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 3f362232d5ee..fdf5073c7c6c 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -2320,18 +2320,20 @@ static inline int ufshcd_hba_capabilities(struct ufs_hba *hba)
/* Read crypto capabilities */
err = ufshcd_hba_init_crypto_capabilities(hba);
- if (err)
+ if (err) {
dev_err(hba->dev, "crypto setup failed\n");
+ return err;
+ }
hba->mcq_sup = FIELD_GET(MASK_MCQ_SUPPORT, hba->capabilities);
if (!hba->mcq_sup)
- return err;
+ return 0;
hba->mcq_capabilities = ufshcd_readl(hba, REG_MCQCAP);
hba->ext_iid_sup = FIELD_GET(MASK_EXT_IID_SUPPORT,
hba->mcq_capabilities);
- return err;
+ return 0;
}
/**