Skip to content

Commit d76d9d7

Browse files
ebiggersstorulf
authored andcommitted
scsi: ufs: use devm_blk_ksm_init()
Use the new resource-managed variant of blk_ksm_init() so that the UFS driver doesn't have to manually call blk_ksm_destroy(). Signed-off-by: Eric Biggers <[email protected]> Reviewed-by: Satya Tangirala <[email protected]> Link: https://lore.kernel.org/r/[email protected] Acked-by: Martin K. Petersen <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
1 parent 5851d3b commit d76d9d7

File tree

3 files changed

+2
-13
lines changed

3 files changed

+2
-13
lines changed

drivers/scsi/ufs/ufshcd-crypto.c

+2-7
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ int ufshcd_hba_init_crypto_capabilities(struct ufs_hba *hba)
179179
}
180180

181181
/* The actual number of configurations supported is (CFGC+1) */
182-
err = blk_ksm_init(&hba->ksm,
183-
hba->crypto_capabilities.config_count + 1);
182+
err = devm_blk_ksm_init(hba->dev, &hba->ksm,
183+
hba->crypto_capabilities.config_count + 1);
184184
if (err)
185185
goto out_free_caps;
186186

@@ -238,8 +238,3 @@ void ufshcd_crypto_setup_rq_keyslot_manager(struct ufs_hba *hba,
238238
if (hba->caps & UFSHCD_CAP_CRYPTO)
239239
blk_ksm_register(&hba->ksm, q);
240240
}
241-
242-
void ufshcd_crypto_destroy_keyslot_manager(struct ufs_hba *hba)
243-
{
244-
blk_ksm_destroy(&hba->ksm);
245-
}

drivers/scsi/ufs/ufshcd-crypto.h

-5
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ void ufshcd_init_crypto(struct ufs_hba *hba);
4343
void ufshcd_crypto_setup_rq_keyslot_manager(struct ufs_hba *hba,
4444
struct request_queue *q);
4545

46-
void ufshcd_crypto_destroy_keyslot_manager(struct ufs_hba *hba);
47-
4846
#else /* CONFIG_SCSI_UFS_CRYPTO */
4947

5048
static inline void ufshcd_prepare_lrbp_crypto(struct request *rq,
@@ -69,9 +67,6 @@ static inline void ufshcd_init_crypto(struct ufs_hba *hba) { }
6967
static inline void ufshcd_crypto_setup_rq_keyslot_manager(struct ufs_hba *hba,
7068
struct request_queue *q) { }
7169

72-
static inline void ufshcd_crypto_destroy_keyslot_manager(struct ufs_hba *hba)
73-
{ }
74-
7570
#endif /* CONFIG_SCSI_UFS_CRYPTO */
7671

7772
#endif /* _UFSHCD_CRYPTO_H */

drivers/scsi/ufs/ufshcd.c

-1
Original file line numberDiff line numberDiff line change
@@ -9152,7 +9152,6 @@ EXPORT_SYMBOL_GPL(ufshcd_remove);
91529152
*/
91539153
void ufshcd_dealloc_host(struct ufs_hba *hba)
91549154
{
9155-
ufshcd_crypto_destroy_keyslot_manager(hba);
91569155
scsi_host_put(hba->host);
91579156
}
91589157
EXPORT_SYMBOL_GPL(ufshcd_dealloc_host);

0 commit comments

Comments
 (0)