]> Git Repo - linux.git/blobdiff - drivers/crypto/ccp/ccp-dev-v3.c
crypto: ccp - constify ccp_actions structure
[linux.git] / drivers / crypto / ccp / ccp-dev-v3.c
index 7d5eab49179e6b5513a3a5d41874c039c3090045..d7a71034796705c4c98f7f56b796fe80628bfc94 100644 (file)
@@ -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);
 
@@ -515,7 +526,7 @@ static irqreturn_t ccp_irq_handler(int irq, void *data)
        return IRQ_HANDLED;
 }
 
-static struct ccp_actions ccp3_actions = {
+static const struct ccp_actions ccp3_actions = {
        .perform_aes = ccp_perform_aes,
        .perform_xts_aes = ccp_perform_xts_aes,
        .perform_sha = ccp_perform_sha,
This page took 0.022579 seconds and 4 git commands to generate.