crypto: ccp - Register the CCP as a DMA resource
The CCP has the ability to provide DMA services to the kernel using pass-through mode of the device. Register these services as general purpose DMA channels. Changes since v2: - Add a Signed-off-by Changes since v1: - Allocate memory for a string in ccp_dmaengine_register - Ensure register/unregister calls are properly ordered - Verified all changed files are listed in the diffstat - Undo some superfluous changes - Added a cc: Signed-off-by: Gary R Hook <gary.hook@amd.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
@@ -406,6 +406,11 @@ static int ccp_init(struct ccp_device *ccp)
|
||||
goto e_kthread;
|
||||
}
|
||||
|
||||
/* Register the DMA engine support */
|
||||
ret = ccp_dmaengine_register(ccp);
|
||||
if (ret)
|
||||
goto e_hwrng;
|
||||
|
||||
ccp_add_device(ccp);
|
||||
|
||||
/* Enable interrupts */
|
||||
@@ -413,6 +418,9 @@ static int ccp_init(struct ccp_device *ccp)
|
||||
|
||||
return 0;
|
||||
|
||||
e_hwrng:
|
||||
hwrng_unregister(&ccp->hwrng);
|
||||
|
||||
e_kthread:
|
||||
for (i = 0; i < ccp->cmd_q_count; i++)
|
||||
if (ccp->cmd_q[i].kthread)
|
||||
@@ -436,6 +444,9 @@ static void ccp_destroy(struct ccp_device *ccp)
|
||||
/* Remove this device from the list of available units first */
|
||||
ccp_del_device(ccp);
|
||||
|
||||
/* Unregister the DMA engine */
|
||||
ccp_dmaengine_unregister(ccp);
|
||||
|
||||
/* Unregister the RNG */
|
||||
hwrng_unregister(&ccp->hwrng);
|
||||
|
||||
|
Reference in New Issue
Block a user