]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
MLK-9769-14 Add CRYPTO_ALG_KERN_DRIVER_ONLY flag to Freescale CAAM driver
authorVictoria Milhoan (b42089) <vicki.milhoan@freescale.com>
Fri, 29 Mar 2013 07:13:14 +0000 (00:13 -0700)
committerNitin Garg <nitin.garg@freescale.com>
Fri, 16 Jan 2015 03:19:56 +0000 (21:19 -0600)
The CRYPTO_ALG_KERN_DRIVER_ONLY flag is used to indicate that
the crypto algorithm is only available via a kernel driver.
This patch adds the flag only when the flag is available in the
kernel.  Utilizing the flag based on it's availability in the
kernel allows the driver to compile on older kernel versions.

The original community patch is located at
http://permalink.gmane.org/gmane.linux.kernel.cryptoapi/6547
for reference.

Signed-off-by: Victoria Milhoan (b42089) <vicki.milhoan@freescale.com>
drivers/crypto/caam/caamalg.c

index 9cc2c706a5e9b0c205336c4980c34bb2acffb6a6..62e5ec138f6c15b8797a7ef05fce876719d7be82 100644 (file)
@@ -2201,8 +2201,12 @@ static struct caam_crypto_alg *caam_alg_alloc(struct caam_alg_template
        alg->cra_blocksize = template->blocksize;
        alg->cra_alignmask = 0;
        alg->cra_ctxsize = sizeof(struct caam_ctx);
-       alg->cra_flags = CRYPTO_ALG_ASYNC | CRYPTO_ALG_KERN_DRIVER_ONLY |
-                        template->type;
+       alg->cra_flags = CRYPTO_ALG_ASYNC | template->type;
+
+#ifdef CRYPTO_ALG_KERN_DRIVER_ONLY
+       alg->cra_flags |= CRYPTO_ALG_KERN_DRIVER_ONLY;
+#endif
+
        switch (template->type) {
        case CRYPTO_ALG_TYPE_ABLKCIPHER:
                alg->cra_type = &crypto_ablkcipher_type;