Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5933985ybi; Wed, 12 Jun 2019 10:58:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqyYzDryUKy8pqiD+JQ1Ec76GUKj/RkyhY2UpiacVOm8KBgLVyc3FAlSDElOP9sYsdIZ0is1 X-Received: by 2002:a63:8dc4:: with SMTP id z187mr26556969pgd.337.1560362308313; Wed, 12 Jun 2019 10:58:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560362308; cv=none; d=google.com; s=arc-20160816; b=x3Yu1a3sg0HRZS7Z5qeOIY8hPG9CoE1Ez4jsuJm3Wrvf1LyDsgmGu1tPbGMph9MQoj bF29ThkRSpljTrLszjd6mQpjwWXxJPbA/L6e4yp/5we9PEkrexctpG3j0Rs54GjL5IML iNjGo/qcQZfhj7G6Ky88AagBWne2DGP1fcGgZnJvOESRD/YbO4vbISRjrGcOzMvmmQqz FgUJCuSfmuQwB5hpL847Oj6ttKwIi+4T3QfDmWKkGoCPEWyTNT5C1VwLA88IfDJsCGwK 6aN6vHiIG2owZLr47ag4x/GnWceFSXpqqO8Qj5mBxxL44GGNWekYBkSj01BanS08yYBp w98Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=e+A5L7P5BNvELInxJ/Dy8IOpTeS4sIo5/WNlmd9iKi0=; b=V5sAtCldplgGA748ly0bFvseACex3G/UBze6eRUeeYUU4p0eIG/DG8jBq7OdBBftX2 PalV10wA6ZjFtYzsCqxzke67nlR6JrmRTrXWNp7a8kAAZrsi/hX7YJboAgDvmmfk0t1v SsEe6jeroPJ4oydQM2nPvWD/7FkmlacfFbkhyvBKYlkQikwquY6KLUallKIMsucTlHQA ORkIGQkbkIxUXx8HC4VQmf0TqYEBPbZYoXu103kD/321KRhCwJS8Ne1OatkLevvTYXHE CWivX9waT6+vvvVrm9BsNo54vy/UAo9M0AQ83BksHjirfBRqVpQZn9rCE1dwgS8R/2O2 BQuQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n5si296049plk.423.2019.06.12.10.58.14; Wed, 12 Jun 2019 10:58:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405847AbfFLNdY (ORCPT + 99 others); Wed, 12 Jun 2019 09:33:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32962 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728540AbfFLNdX (ORCPT ); Wed, 12 Jun 2019 09:33:23 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E0CA2A3B64; Wed, 12 Jun 2019 13:33:20 +0000 (UTC) Received: from t460s.redhat.com (ovpn-116-159.ams2.redhat.com [10.36.116.159]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF3C078DF0; Wed, 12 Jun 2019 13:33:18 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-s390@vger.kernel.org, linux-crypto@vger.kernel.org, David Hildenbrand , Herbert Xu , "David S. Miller" , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Harald Freudenberger , Cornelia Huck Subject: [PATCH v3 3/4] s390/crypto: prng: Use -ENODEV instead of -EOPNOTSUPP Date: Wed, 12 Jun 2019 15:33:05 +0200 Message-Id: <20190612133306.10231-4-david@redhat.com> In-Reply-To: <20190612133306.10231-1-david@redhat.com> References: <20190612133306.10231-1-david@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 12 Jun 2019 13:33:23 +0000 (UTC) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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 Reviewed-by: Harald Freudenberger Signed-off-by: David Hildenbrand --- arch/s390/crypto/prng.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/s390/crypto/prng.c b/arch/s390/crypto/prng.c index 12cca467af7d..d977643fa627 100644 --- a/arch/s390/crypto/prng.c +++ b/arch/s390/crypto/prng.c @@ -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 -- 2.21.0