diff options
author | Eric Biggers <ebiggers@google.com> | 2024-12-12 20:19:47 -0800 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2025-01-02 13:36:15 -0500 |
commit | 409f21010d92a9a5c3b66bacd3b853f4d71ca26c (patch) | |
tree | 3b9858c24413fcca3ba1bb33ab46aa97b2e52cae | |
parent | 30b32c647cf309d8fc70ba068a2918033e3a1bc4 (diff) |
scsi: ufs: crypto: Remove ufs_hba_variant_ops::program_key
There are no longer any implementations of
ufs_hba_variant_ops::program_key, so remove it.
As a result, ufshcd_program_key() no longer can return an error, so also
clean it up to return void.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Link: https://lore.kernel.org/r/20241213041958.202565-5-ebiggers@kernel.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/ufs/core/ufshcd-crypto.c | 20 | ||||
-rw-r--r-- | include/ufs/ufshcd.h | 3 |
2 files changed, 6 insertions, 17 deletions
diff --git a/drivers/ufs/core/ufshcd-crypto.c b/drivers/ufs/core/ufshcd-crypto.c index 0cb425ef618e..694ff7578fc1 100644 --- a/drivers/ufs/core/ufshcd-crypto.c +++ b/drivers/ufs/core/ufshcd-crypto.c @@ -17,20 +17,14 @@ static const struct ufs_crypto_alg_entry { }, }; -static int ufshcd_program_key(struct ufs_hba *hba, - const union ufs_crypto_cfg_entry *cfg, int slot) +static void ufshcd_program_key(struct ufs_hba *hba, + const union ufs_crypto_cfg_entry *cfg, int slot) { int i; u32 slot_offset = hba->crypto_cfg_register + slot * sizeof(*cfg); - int err = 0; ufshcd_hold(hba); - if (hba->vops && hba->vops->program_key) { - err = hba->vops->program_key(hba, cfg, slot); - goto out; - } - /* Ensure that CFGE is cleared before programming the key */ ufshcd_writel(hba, 0, slot_offset + 16 * sizeof(cfg->reg_val[0])); for (i = 0; i < 16; i++) { @@ -43,9 +37,7 @@ static int ufshcd_program_key(struct ufs_hba *hba, /* Dword 16 must be written last */ ufshcd_writel(hba, le32_to_cpu(cfg->reg_val[16]), slot_offset + 16 * sizeof(cfg->reg_val[0])); -out: ufshcd_release(hba); - return err; } static int ufshcd_crypto_keyslot_program(struct blk_crypto_profile *profile, @@ -60,7 +52,6 @@ static int ufshcd_crypto_keyslot_program(struct blk_crypto_profile *profile, int i; int cap_idx = -1; union ufs_crypto_cfg_entry cfg = {}; - int err; BUILD_BUG_ON(UFS_CRYPTO_KEY_SIZE_INVALID != 0); for (i = 0; i < hba->crypto_capabilities.num_crypto_cap; i++) { @@ -88,10 +79,10 @@ static int ufshcd_crypto_keyslot_program(struct blk_crypto_profile *profile, memcpy(cfg.crypto_key, key->raw, key->size); } - err = ufshcd_program_key(hba, &cfg, slot); + ufshcd_program_key(hba, &cfg, slot); memzero_explicit(&cfg, sizeof(cfg)); - return err; + return 0; } static int ufshcd_crypto_keyslot_evict(struct blk_crypto_profile *profile, @@ -105,7 +96,8 @@ static int ufshcd_crypto_keyslot_evict(struct blk_crypto_profile *profile, */ union ufs_crypto_cfg_entry cfg = {}; - return ufshcd_program_key(hba, &cfg, slot); + ufshcd_program_key(hba, &cfg, slot); + return 0; } /* diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h index ec0cbffc44ce..4d9d9cf6ee46 100644 --- a/include/ufs/ufshcd.h +++ b/include/ufs/ufshcd.h @@ -324,7 +324,6 @@ struct ufs_pwr_mode_info { * @phy_initialization: used to initialize phys * @device_reset: called to issue a reset pulse on the UFS device * @config_scaling_param: called to configure clock scaling parameters - * @program_key: program or evict an inline encryption key * @fill_crypto_prdt: initialize crypto-related fields in the PRDT * @event_notify: called to notify important events * @reinit_notify: called to notify reinit of UFSHCD during max gear switch @@ -372,8 +371,6 @@ struct ufs_hba_variant_ops { void (*config_scaling_param)(struct ufs_hba *hba, struct devfreq_dev_profile *profile, struct devfreq_simple_ondemand_data *data); - int (*program_key)(struct ufs_hba *hba, - const union ufs_crypto_cfg_entry *cfg, int slot); int (*fill_crypto_prdt)(struct ufs_hba *hba, const struct bio_crypt_ctx *crypt_ctx, void *prdt, unsigned int num_segments); |