s390/crypto: prng: Use -ENODEV instead of -EOPNOTSUPP
authorDavid Hildenbrand <david@redhat.com>
Wed, 12 Jun 2019 13:33:05 +0000 (15:33 +0200)
committerHeiko Carstens <heiko.carstens@de.ibm.com>
Sat, 15 Jun 2019 10:24:44 +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/prng.c

index 12cca467af7d101cd53d10b4c54815f7190a6364..d977643fa6271bb62cb82b6813f87479a70d70ef 100644 (file)
@@ -824,7 +824,7 @@ static int __init prng_init(void)
 
        /* check if the CPU has a PRNG */
        if (!cpacf_query_func(CPACF_KMC, CPACF_KMC_PRNG))
-               return -EOPNOTSUPP;
+               return -ENODEV;
 
        /* check if TRNG subfunction is available */
        if (cpacf_query_func(CPACF_PRNO, CPACF_PRNO_TRNG))
@@ -837,7 +837,7 @@ static int __init prng_init(void)
                        if (prng_mode == PRNG_MODE_SHA512) {
                                pr_err("The prng module cannot "
                                       "start in SHA-512 mode\n");
-                               return -EOPNOTSUPP;
+                               return -ENODEV;
                        }
                        prng_mode = PRNG_MODE_TDES;
                } else