From patchwork Thu Jul 13 07:04:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 119575 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp1642385vqm; Thu, 13 Jul 2023 00:11:41 -0700 (PDT) X-Google-Smtp-Source: APBJJlGTN3+hDqqW7zglepIUc2NfWAi442mcBUsEzG+Yb7TzSfXv8XQD7sOTLj/Qpqs7ydO6+2U3 X-Received: by 2002:a17:906:77cb:b0:992:ef60:aadd with SMTP id m11-20020a17090677cb00b00992ef60aaddmr1591482ejn.13.1689232301153; Thu, 13 Jul 2023 00:11:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689232301; cv=none; d=google.com; s=arc-20160816; b=P81Dx1X8eDYIAGAaZ/hkHu9Aysdag8MtpwGzxoRV5id+Xh+zv7Us4no9TzV9CW24cE mYA4FmKIAor666F8LJ+CRR0w9rf3bN1OZdnp2qDrOB1yv4AhgBajcIrfm0llpnyyTP7c /6FPISqwMX+OqG3ChWDmHHTwX9JKXbJUwFO3ABNy0hY5kblF6IFuEtu+bnPuVZd3CjxM iCI4dq8TCknH66JIDFRQcT9eRP98lf3Q9X+mkxJgOmd9RV8Evwv4e4ahtJSYf/eb0SBY z5bh7pYQ/FL5XLEtqlzRgoykjoNXA4PCftPbMeiNjyVvuvWp6LrKjZJtwFz5LgWlBS3r LfOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=vsKmDlYeSPZ8hEJhBgjErmEmqfrQmfr3rHGRf1SlCpA=; fh=E5JFeCCQh9Lu/4SbiHM0xXDZNRS+26I/orGAtH3zI6M=; b=NtBl5WyjF4wdQlVde5q3tdPzGdk7qBDyyZiAWUgZ8I5o0jA0OV+2z10E8FenQ4UmKh KqS5pyC86pfaiiGkxDOJzNEAiBaKyrLq630llMQ0Fqf6zBCanfOA68mPz60NOxNpJJSX sML/wrrplzG84RFSPoXLgiVbZblBoPs3LejodAvh/MA9qiakXV6VhhWPadA9lKwNnbUJ /ycAE8elX57Of726hnO5u/zY4AxukRjTTaSZPqPWvhWsyMMtdAZToJW7AOPgD6+36k0z BiXOMnKwFwgyIi2vPANgJFb8G+8zziT89si2kYKJNUnDW+T1j9gZClDtmyu5ygYHOab6 XQTA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c4-20020a17090603c400b0097650856f55si6501819eja.695.2023.07.13.00.11.17; Thu, 13 Jul 2023 00:11:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234055AbjGMHGs (ORCPT + 99 others); Thu, 13 Jul 2023 03:06:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233945AbjGMHGl (ORCPT ); Thu, 13 Jul 2023 03:06:41 -0400 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35C9A172C; Thu, 13 Jul 2023 00:06:40 -0700 (PDT) Received: from 74.172.62.81.static.wline.lns.sme.cust.swisscom.ch ([81.62.172.74] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1qJqPN-0004KN-CF; Thu, 13 Jul 2023 09:06:37 +0200 From: Martin Kaiser To: Herbert Xu Cc: olivier@sobrie.be, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 3/3] hwrng: ba431 - use dev_err_probe after failed registration Date: Thu, 13 Jul 2023 09:04:46 +0200 Message-Id: <20230713070446.230978-4-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230713070446.230978-1-martin@kaiser.cx> References: <20230713070446.230978-1-martin@kaiser.cx> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771288449661001420 X-GMAIL-MSGID: 1771288449661001420 Use dev_err_probe to print the error message after a failed hwrng registration. Signed-off-by: Martin Kaiser --- drivers/char/hw_random/ba431-rng.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/char/hw_random/ba431-rng.c b/drivers/char/hw_random/ba431-rng.c index d2a9d16323a6..9de7466e6896 100644 --- a/drivers/char/hw_random/ba431-rng.c +++ b/drivers/char/hw_random/ba431-rng.c @@ -190,10 +190,8 @@ static int ba431_trng_probe(struct platform_device *pdev) ba431->rng.read = ba431_trng_read; ret = devm_hwrng_register(&pdev->dev, &ba431->rng); - if (ret) { - dev_err(&pdev->dev, "BA431 registration failed (%d)\n", ret); - return ret; - } + if (ret) + return dev_err_probe(&pdev->dev, ret, "BA431 registration failed\n"); dev_info(&pdev->dev, "BA431 TRNG registered\n");