Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <ebiggers@google.com>
Reviewed-by: Satya Tangirala <satyat@google.com>
Link: https://lore.kernel.org/r/20210121082155.111333-3-ebiggers@kernel.org
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Eric Biggers and committed by
Ulf Hansson
d76d9d7d 5851d3b0

+2 -13
+2 -7
drivers/scsi/ufs/ufshcd-crypto.c
··· 179 179 } 180 180 181 181 /* 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); 184 184 if (err) 185 185 goto out_free_caps; 186 186 ··· 237 237 { 238 238 if (hba->caps & UFSHCD_CAP_CRYPTO) 239 239 blk_ksm_register(&hba->ksm, q); 240 - } 241 - 242 - void ufshcd_crypto_destroy_keyslot_manager(struct ufs_hba *hba) 243 - { 244 - blk_ksm_destroy(&hba->ksm); 245 240 }
-5
drivers/scsi/ufs/ufshcd-crypto.h
··· 43 43 void ufshcd_crypto_setup_rq_keyslot_manager(struct ufs_hba *hba, 44 44 struct request_queue *q); 45 45 46 - void ufshcd_crypto_destroy_keyslot_manager(struct ufs_hba *hba); 47 - 48 46 #else /* CONFIG_SCSI_UFS_CRYPTO */ 49 47 50 48 static inline void ufshcd_prepare_lrbp_crypto(struct request *rq, ··· 66 68 67 69 static inline void ufshcd_crypto_setup_rq_keyslot_manager(struct ufs_hba *hba, 68 70 struct request_queue *q) { } 69 - 70 - static inline void ufshcd_crypto_destroy_keyslot_manager(struct ufs_hba *hba) 71 - { } 72 71 73 72 #endif /* CONFIG_SCSI_UFS_CRYPTO */ 74 73
-1
drivers/scsi/ufs/ufshcd.c
··· 9152 9152 */ 9153 9153 void ufshcd_dealloc_host(struct ufs_hba *hba) 9154 9154 { 9155 - ufshcd_crypto_destroy_keyslot_manager(hba); 9156 9155 scsi_host_put(hba->host); 9157 9156 } 9158 9157 EXPORT_SYMBOL_GPL(ufshcd_dealloc_host);