]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
crypto: ccp - Enable DMA service on a v5 CCP
authorGary R Hook <gary.hook@amd.com>
Wed, 27 Jul 2016 00:10:40 +0000 (19:10 -0500)
committerSomasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Thu, 24 Aug 2017 17:55:03 +0000 (10:55 -0700)
Orabug: 26644685

Every CCP is capable of providing general DMA services.
Register the device as a provider.

Signed-off-by: Gary R Hook <gary.hook@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit 99d90b2ebd8b327c0c496798db99009b30c70945)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
drivers/crypto/ccp/ccp-dev-v5.c

index ddce2205e5faf332246de757d16f58384992a426..40867141aea8e2a8e2d472eeaeac0544c34b7688 100644 (file)
@@ -832,6 +832,11 @@ static int ccp5_init(struct ccp_device *ccp)
        if (ret)
                goto e_kthread;
 
+       /* Register the DMA engine support */
+       ret = ccp_dmaengine_register(ccp);
+       if (ret)
+               goto e_hwrng;
+
        return 0;
 
 e_kthread:
@@ -856,6 +861,9 @@ static void ccp5_destroy(struct ccp_device *ccp)
        struct ccp_cmd *cmd;
        unsigned int i;
 
+       /* Unregister the DMA engine */
+       ccp_dmaengine_unregister(ccp);
+
        /* Unregister the RNG */
        ccp_unregister_rng(ccp);