s390/crypto: sha: Use -ENODEV instead of -EOPNOTSUPP
authorDavid Hildenbrand <david@redhat.com>
Wed, 12 Jun 2019 13:33:06 +0000 (15:33 +0200)
committerHeiko Carstens <heiko.carstens@de.ibm.com>
Sat, 15 Jun 2019 10:24:48 +0000 (12:24 +0200)
Let's use the error value that is typically used if HW support is not
available when trying to load a module - this is also what systemd's
systemd-modules-load.service expects.

Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
arch/s390/crypto/sha1_s390.c
arch/s390/crypto/sha256_s390.c
arch/s390/crypto/sha512_s390.c

index 009572e8276da7918fd61369a88fff404c067ac4..7c15542d3685479713a06643e883503789d7b7a5 100644 (file)
@@ -86,7 +86,7 @@ static struct shash_alg alg = {
 static int __init sha1_s390_init(void)
 {
        if (!cpacf_query_func(CPACF_KIMD, CPACF_KIMD_SHA_1))
-               return -EOPNOTSUPP;
+               return -ENODEV;
        return crypto_register_shash(&alg);
 }
 
index 62833a1d87240836499c416c2a763b73f30cc872..af7505148f806ebd1286fa32e4c9f06e97d22499 100644 (file)
@@ -117,7 +117,7 @@ static int __init sha256_s390_init(void)
        int ret;
 
        if (!cpacf_query_func(CPACF_KIMD, CPACF_KIMD_SHA_256))
-               return -EOPNOTSUPP;
+               return -ENODEV;
        ret = crypto_register_shash(&sha256_alg);
        if (ret < 0)
                goto out;
index be589c340d159ee05964f802b1163e2ec449d5a9..ad29db085a1884973e2f02119b81176c680909eb 100644 (file)
@@ -127,7 +127,7 @@ static int __init init(void)
        int ret;
 
        if (!cpacf_query_func(CPACF_KIMD, CPACF_KIMD_SHA_512))
-               return -EOPNOTSUPP;
+               return -ENODEV;
        if ((ret = crypto_register_shash(&sha512_alg)) < 0)
                goto out;
        if ((ret = crypto_register_shash(&sha384_alg)) < 0)