Skip to content

Commit 409f210

Browse files
ebiggersmartinkpetersen
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 30b32c6 commit 409f210

File tree

2 files changed

+6
-17
lines changed

2 files changed

+6
-17
lines changed

drivers/ufs/core/ufshcd-crypto.c

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,14 @@ static const struct ufs_crypto_alg_entry {
1717
},
1818
};
1919

20-
static int ufshcd_program_key(struct ufs_hba *hba,
21-
const union ufs_crypto_cfg_entry *cfg, int slot)
20+
static void ufshcd_program_key(struct ufs_hba *hba,
21+
const union ufs_crypto_cfg_entry *cfg, int slot)
2222
{
2323
int i;
2424
u32 slot_offset = hba->crypto_cfg_register + slot * sizeof(*cfg);
25-
int err = 0;
2625

2726
ufshcd_hold(hba);
2827

29-
if (hba->vops && hba->vops->program_key) {
30-
err = hba->vops->program_key(hba, cfg, slot);
31-
goto out;
32-
}
33-
3428
/* Ensure that CFGE is cleared before programming the key */
3529
ufshcd_writel(hba, 0, slot_offset + 16 * sizeof(cfg->reg_val[0]));
3630
for (i = 0; i < 16; i++) {
@@ -43,9 +37,7 @@ static int ufshcd_program_key(struct ufs_hba *hba,
4337
/* Dword 16 must be written last */
4438
ufshcd_writel(hba, le32_to_cpu(cfg->reg_val[16]),
4539
slot_offset + 16 * sizeof(cfg->reg_val[0]));
46-
out:
4740
ufshcd_release(hba);
48-
return err;
4941
}
5042

5143
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,
6052
int i;
6153
int cap_idx = -1;
6254
union ufs_crypto_cfg_entry cfg = {};
63-
int err;
6455

6556
BUILD_BUG_ON(UFS_CRYPTO_KEY_SIZE_INVALID != 0);
6657
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,
8879
memcpy(cfg.crypto_key, key->raw, key->size);
8980
}
9081

91-
err = ufshcd_program_key(hba, &cfg, slot);
82+
ufshcd_program_key(hba, &cfg, slot);
9283

9384
memzero_explicit(&cfg, sizeof(cfg));
94-
return err;
85+
return 0;
9586
}
9687

9788
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,
10596
*/
10697
union ufs_crypto_cfg_entry cfg = {};
10798

108-
return ufshcd_program_key(hba, &cfg, slot);
99+
ufshcd_program_key(hba, &cfg, slot);
100+
return 0;
109101
}
110102

111103
/*

include/ufs/ufshcd.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,6 @@ struct ufs_pwr_mode_info {
324324
* @phy_initialization: used to initialize phys
325325
* @device_reset: called to issue a reset pulse on the UFS device
326326
* @config_scaling_param: called to configure clock scaling parameters
327-
* @program_key: program or evict an inline encryption key
328327
* @fill_crypto_prdt: initialize crypto-related fields in the PRDT
329328
* @event_notify: called to notify important events
330329
* @reinit_notify: called to notify reinit of UFSHCD during max gear switch
@@ -372,8 +371,6 @@ struct ufs_hba_variant_ops {
372371
void (*config_scaling_param)(struct ufs_hba *hba,
373372
struct devfreq_dev_profile *profile,
374373
struct devfreq_simple_ondemand_data *data);
375-
int (*program_key)(struct ufs_hba *hba,
376-
const union ufs_crypto_cfg_entry *cfg, int slot);
377374
int (*fill_crypto_prdt)(struct ufs_hba *hba,
378375
const struct bio_crypt_ctx *crypt_ctx,
379376
void *prdt, unsigned int num_segments);

0 commit comments

Comments
 (0)