Merge tag 'powerpc-4.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
[cascardo/linux.git] / drivers / crypto / vmx / vmx.c
index e163d57..31a98dc 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/moduleparam.h>
 #include <linux/types.h>
 #include <linux/err.h>
+#include <linux/cpufeature.h>
 #include <linux/crypto.h>
 #include <asm/cputable.h>
 #include <crypto/internal/hash.h>
@@ -31,10 +32,12 @@ extern struct shash_alg p8_ghash_alg;
 extern struct crypto_alg p8_aes_alg;
 extern struct crypto_alg p8_aes_cbc_alg;
 extern struct crypto_alg p8_aes_ctr_alg;
+extern struct crypto_alg p8_aes_xts_alg;
 static struct crypto_alg *algs[] = {
        &p8_aes_alg,
        &p8_aes_cbc_alg,
        &p8_aes_ctr_alg,
+       &p8_aes_xts_alg,
        NULL,
 };
 
@@ -43,9 +46,6 @@ int __init p8_init(void)
        int ret = 0;
        struct crypto_alg **alg_it;
 
-       if (!(cur_cpu_spec->cpu_user_features2 & PPC_FEATURE2_VEC_CRYPTO))
-               return -ENODEV;
-
        for (alg_it = algs; *alg_it; alg_it++) {
                ret = crypto_register_alg(*alg_it);
                printk(KERN_INFO "crypto_register_alg '%s' = %d\n",
@@ -78,7 +78,7 @@ void __exit p8_exit(void)
        crypto_unregister_shash(&p8_ghash_alg);
 }
 
-module_init(p8_init);
+module_cpu_feature_match(PPC_MODULE_FEATURE_VEC_CRYPTO, p8_init);
 module_exit(p8_exit);
 
 MODULE_AUTHOR("Marcelo Cerri<mhcerri@br.ibm.com>");