Commit 45488c48 authored by David Hildenbrand's avatar David Hildenbrand Committed by Heiko Carstens

s390/crypto: sha: Use -ENODEV instead of -EOPNOTSUPP

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: default avatarCornelia Huck <cohuck@redhat.com>
Reviewed-by: default avatarHarald Freudenberger <freude@linux.ibm.com>
Signed-off-by: default avatarDavid Hildenbrand <david@redhat.com>
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
parent ba6a98fe
...@@ -86,7 +86,7 @@ static struct shash_alg alg = { ...@@ -86,7 +86,7 @@ static struct shash_alg alg = {
static int __init sha1_s390_init(void) static int __init sha1_s390_init(void)
{ {
if (!cpacf_query_func(CPACF_KIMD, CPACF_KIMD_SHA_1)) if (!cpacf_query_func(CPACF_KIMD, CPACF_KIMD_SHA_1))
return -EOPNOTSUPP; return -ENODEV;
return crypto_register_shash(&alg); return crypto_register_shash(&alg);
} }
......
...@@ -117,7 +117,7 @@ static int __init sha256_s390_init(void) ...@@ -117,7 +117,7 @@ static int __init sha256_s390_init(void)
int ret; int ret;
if (!cpacf_query_func(CPACF_KIMD, CPACF_KIMD_SHA_256)) if (!cpacf_query_func(CPACF_KIMD, CPACF_KIMD_SHA_256))
return -EOPNOTSUPP; return -ENODEV;
ret = crypto_register_shash(&sha256_alg); ret = crypto_register_shash(&sha256_alg);
if (ret < 0) if (ret < 0)
goto out; goto out;
......
...@@ -127,7 +127,7 @@ static int __init init(void) ...@@ -127,7 +127,7 @@ static int __init init(void)
int ret; int ret;
if (!cpacf_query_func(CPACF_KIMD, CPACF_KIMD_SHA_512)) if (!cpacf_query_func(CPACF_KIMD, CPACF_KIMD_SHA_512))
return -EOPNOTSUPP; return -ENODEV;
if ((ret = crypto_register_shash(&sha512_alg)) < 0) if ((ret = crypto_register_shash(&sha512_alg)) < 0)
goto out; goto out;
if ((ret = crypto_register_shash(&sha384_alg)) < 0) if ((ret = crypto_register_shash(&sha384_alg)) < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment