summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/ccp/ccp-dev.c
diff options
context:
space:
mode:
authorGary R Hook <gary.hook@amd.com>2016-10-19 00:33:37 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2016-10-25 05:08:23 +0200
commit103600ab966a2f02d8986bbfdf87b762b1c6a06d (patch)
tree35cca53e7805aaf34f5d4432cd53ea2def92f811 /drivers/crypto/ccp/ccp-dev.c
parentcrypto: ccp - remove unneeded code (diff)
downloadlinux-103600ab966a2f02d8986bbfdf87b762b1c6a06d.tar.xz
linux-103600ab966a2f02d8986bbfdf87b762b1c6a06d.zip
crypto: ccp - Clean up the LSB slot allocation code
Fix a few problems revealed by testing: verify consistent units, especially in public slot allocation. Percolate some common initialization code up to a common routine. Add some comments. Signed-off-by: Gary R Hook <gary.hook@amd.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/ccp/ccp-dev.c')
-rw-r--r--drivers/crypto/ccp/ccp-dev.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/crypto/ccp/ccp-dev.c b/drivers/crypto/ccp/ccp-dev.c
index c25515a80d33..511ab042b5e7 100644
--- a/drivers/crypto/ccp/ccp-dev.c
+++ b/drivers/crypto/ccp/ccp-dev.c
@@ -478,6 +478,10 @@ struct ccp_device *ccp_alloc_struct(struct device *dev)
ccp->sb_count = KSB_COUNT;
ccp->sb_start = 0;
+ /* Initialize the wait queues */
+ init_waitqueue_head(&ccp->sb_queue);
+ init_waitqueue_head(&ccp->suspend_queue);
+
ccp->ord = ccp_increment_unit_ordinal();
snprintf(ccp->name, MAX_CCP_NAME_LEN, "ccp-%u", ccp->ord);
snprintf(ccp->rngname, MAX_CCP_NAME_LEN, "ccp-%u-rng", ccp->ord);