From 8e8f55d1a7e865562d2e3e022a7fcf13753a9c8e Mon Sep 17 00:00:00 2001 From: Satya Tangirala Date: Thu, 7 Nov 2019 21:16:46 -0800 Subject: [PATCH] ANDROID: scsi: ufs: UFS init should not require inline crypto UFS initialization should carry on even if inline crypto support is absent, instead of just erroring out. Bug: 137270441 Change-Id: I4a508640f803dc8aaff1033b5e1d5c229a0b03de Signed-off-by: Satya Tangirala --- drivers/scsi/ufs/ufshcd-crypto.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd-crypto.c b/drivers/scsi/ufs/ufshcd-crypto.c index 988d8df8f394..7599d77725e4 100644 --- a/drivers/scsi/ufs/ufshcd-crypto.c +++ b/drivers/scsi/ufs/ufshcd-crypto.c @@ -301,8 +301,7 @@ static const struct keyslot_mgmt_ll_ops ufshcd_ksm_ops = { * ufshcd_hba_init_crypto - Read crypto capabilities, init crypto fields in hba * @hba: Per adapter instance * - * Returns 0 on success. Returns -ENODEV if such capabilities don't exist, and - * -ENOMEM upon OOM. + * Return: 0 if crypto was initialized or is not supported, else a -errno value. */ int ufshcd_hba_init_crypto_spec(struct ufs_hba *hba, const struct keyslot_mgmt_ll_ops *ksm_ops) @@ -313,10 +312,9 @@ int ufshcd_hba_init_crypto_spec(struct ufs_hba *hba, /* Default to disabling crypto */ hba->caps &= ~UFSHCD_CAP_CRYPTO; - if (!(hba->capabilities & MASK_CRYPTO_SUPPORT)) { - err = -ENODEV; + /* Return 0 if crypto support isn't present */ + if (!(hba->capabilities & MASK_CRYPTO_SUPPORT)) goto out; - } /* * Crypto Capabilities should never be 0, because the @@ -372,7 +370,6 @@ out_free_crypto_cfgs: out_free_cfg_mem: devm_kfree(hba->dev, hba->crypto_cap_array); out: - // TODO: print error? /* Indicate that init failed by setting crypto_capabilities to 0 */ hba->crypto_capabilities.reg_val = 0; return err;