Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp28556288rwd; Tue, 4 Jul 2023 22:24:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5p9t4bUumlZOtrZZN7MFO6o3IYwJWWeK7Q6wIe+4NxMCdWYIGP7I2tsMz0hRoHM7UNmQIh X-Received: by 2002:a05:6a21:9989:b0:12c:bbd3:a0dd with SMTP id ve9-20020a056a21998900b0012cbbd3a0ddmr22096254pzb.0.1688534667589; Tue, 04 Jul 2023 22:24:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688534667; cv=none; d=google.com; s=arc-20160816; b=FrrF3APgil5zsdZtMqhvYqI7nw6JsS/GLV79LpmwwfutTVmFp2ATlI05qxH5C6TaMA rdoraHL9SIw8akYm+3UDwRv2MX/BrbBecyfE8iHkR8zxxP+tyPqc/QiWKb9Mo15dM+ch hMwjtvhT7NvS2r4klemTz1TP0tPEbRWq8eQ2ZjjOkV3Bp+mbPYZ5S+z1ngb/mUej4tCq qVDpFxdVWX015FW5uSPROA/l2Tx8Zp5RdxCjSi1noL/x+47tWpMpYOWQRxaZ0KZTiMtm QcAFN9/uKP4iGN4iXsTsR3ms1754X1ucn8fXO/+fOWAWTQ31kOms3p3/jNdOeV1Y+Ocr WgGg== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=wKHwOBbzleFu4TllK9tQy3xQ9aBJeRV/+p7/bSM2gMg=; fh=j6PlmhJ80JgmZkim43a37GIQJyTA0VybZNxQzcS/Qpc=; b=wragNDLbcyjgw5VAg9R6PjAa8FpNyr5PDgTsgaXDt+n498Lolv2+dxf065O6JdX6HR 81Usb96Rwt6T8+phFslcEEGpKD6paIyoKeQuko2H4j0fAs1XbjSg3twRPhQ8nG6kzjXw VJZLLKKPbWbGZ8+zTWKAiXQ+8zPa8KcatrAL/xMUCfqEpzC9G8nDR5t3Zpu0H3Fqn0K/ l0MFq/bmUsdCs9y4c38F2MaAPaY8cGKbKizaNtAsXt3kFOTbI1gm7MI1PnD2N7HRJeOy HbCh5ZFWLcnUh5flvRtzqbX/eEjj7PDHTiJZW9Sj1GpsEawhzFc+w37x3Y6bNFuvRFCJ ZXIw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y2-20020aa78f22000000b0063b356e36fesi10457249pfr.372.2023.07.04.22.24.14; Tue, 04 Jul 2023 22:24:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229871AbjGEFVP (ORCPT + 99 others); Wed, 5 Jul 2023 01:21:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229532AbjGEFVO (ORCPT ); Wed, 5 Jul 2023 01:21:14 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDB4C10E3 for ; Tue, 4 Jul 2023 22:21:13 -0700 (PDT) Received: from ptz.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::77] helo=drumknott) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1qGuwx-0000z2-Iz; Wed, 05 Jul 2023 07:21:11 +0200 Date: Wed, 5 Jul 2023 07:21:09 +0200 From: Rouven Czerwinski To: Rouven Czerwinski Cc: Martin Kaiser , Herbert Xu , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] hwrng: imx-rngc - use dev_err_probe Message-ID: <20230705072109.2fc3ee95@drumknott> In-Reply-To: <20230705071431.7487e285@drumknott> References: <20230704170644.69669-1-martin@kaiser.cx> <20230705071431.7487e285@drumknott> Organization: Pengutronix e.K. X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:900:1d::77 X-SA-Exim-Mail-From: r.czerwinski@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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-crypto@vger.kernel.org Hi, On Wed, 5 Jul 2023 07:14:31 +0200 Rouven Czerwinski wrote: > On Tue, 4 Jul 2023 19:06:44 +0200 > Martin Kaiser wrote: > > > Simplify the code by calling dev_err_probe instead of dev_err and > > return. > > > > While at it, use the same device for all error messages. > > > > Signed-off-by: Martin Kaiser > > Reviewed-by: Rouven Czerwinski Please disregard the first tag, the correct one should be Reviewed-by: Rouven Czerwinski (note the missing s), I also fixed the mail address for this new mailer. Sorry for the noise, shouldn't review before the first tea. Best regards, Rouven > > > --- > > drivers/char/hw_random/imx-rngc.c | 24 ++++++++---------------- > > 1 file changed, 8 insertions(+), 16 deletions(-) > > > > diff --git a/drivers/char/hw_random/imx-rngc.c > > b/drivers/char/hw_random/imx-rngc.c index bf07f17f78c8..e4b385b01b11 > > 100644 --- a/drivers/char/hw_random/imx-rngc.c > > +++ b/drivers/char/hw_random/imx-rngc.c > > @@ -239,10 +239,8 @@ static int __init imx_rngc_probe(struct > > platform_device *pdev) return PTR_ERR(rngc->base); > > > > rngc->clk = devm_clk_get_enabled(&pdev->dev, NULL); > > - if (IS_ERR(rngc->clk)) { > > - dev_err(&pdev->dev, "Can not get rng_clk\n"); > > - return PTR_ERR(rngc->clk); > > - } > > + if (IS_ERR(rngc->clk)) > > + return dev_err_probe(&pdev->dev, > > PTR_ERR(rngc->clk), "Cannot get rng_clk\n"); > > irq = platform_get_irq(pdev, 0); > > if (irq < 0) > > @@ -272,24 +270,18 @@ static int __init imx_rngc_probe(struct > > platform_device *pdev) > > ret = devm_request_irq(&pdev->dev, > > irq, imx_rngc_irq, 0, pdev->name, (void > > *)rngc); > > - if (ret) { > > - dev_err(rngc->dev, "Can't get interrupt > > working.\n"); > > - return ret; > > - } > > + if (ret) > > + return dev_err_probe(&pdev->dev, ret, "Can't get > > interrupt working.\n"); > > if (self_test) { > > ret = imx_rngc_self_test(rngc); > > - if (ret) { > > - dev_err(rngc->dev, "self test failed\n"); > > - return ret; > > - } > > + if (ret) > > + return dev_err_probe(&pdev->dev, ret, "self > > test failed\n"); } > > > > ret = devm_hwrng_register(&pdev->dev, &rngc->rng); > > - if (ret) { > > - dev_err(&pdev->dev, "hwrng registration failed\n"); > > - return ret; > > - } > > + if (ret) > > + return dev_err_probe(&pdev->dev, ret, "hwrng > > registration failed\n"); > > dev_info(&pdev->dev, > > "Freescale RNG%c registered (HW revision > > %d.%02d)\n", > >