summaryrefslogtreecommitdiffstats
path: root/arch/arm/crypto/aes-ce-glue.c
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2017-05-21 12:23:36 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2017-06-01 06:55:38 +0200
commit4d8061a5918dea53402170932a861c09f3b88df5 (patch)
tree5efb3ffd741cf9ac9ad8964b5ba27cd3c6805e3e /arch/arm/crypto/aes-ce-glue.c
parentcrypto: ccp - Use IPAD/OPAD constant (diff)
downloadlinux-4d8061a5918dea53402170932a861c09f3b88df5.tar.xz
linux-4d8061a5918dea53402170932a861c09f3b88df5.zip
crypto: arm/aes-ce - enable module autoloading based on CPU feature bits
Make the module autoloadable by tying it to the CPU feature bit that describes whether the optional instructions it relies on are implemented by the current CPU. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r--arch/arm/crypto/aes-ce-glue.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/arm/crypto/aes-ce-glue.c b/arch/arm/crypto/aes-ce-glue.c
index 883b84d828c5..0f966a8ca1ce 100644
--- a/arch/arm/crypto/aes-ce-glue.c
+++ b/arch/arm/crypto/aes-ce-glue.c
@@ -14,6 +14,7 @@
#include <crypto/aes.h>
#include <crypto/internal/simd.h>
#include <crypto/internal/skcipher.h>
+#include <linux/cpufeature.h>
#include <linux/module.h>
#include <crypto/xts.h>
@@ -425,9 +426,6 @@ static int __init aes_init(void)
int err;
int i;
- if (!(elf_hwcap2 & HWCAP2_AES))
- return -ENODEV;
-
err = crypto_register_skciphers(aes_algs, ARRAY_SIZE(aes_algs));
if (err)
return err;
@@ -451,5 +449,5 @@ unregister_simds:
return err;
}
-module_init(aes_init);
+module_cpu_feature_match(AES, aes_init);
module_exit(aes_exit);