Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp28553254rwd; Tue, 4 Jul 2023 22:20:32 -0700 (PDT) X-Google-Smtp-Source: APBJJlFuhzdx3lCK9XExCL/zrDaTSbd/5/kB0reR7mBIAfSm+Xj/l29bYPXLbyWwjrJDmVS8FxLl X-Received: by 2002:a92:7a0b:0:b0:345:db9a:be2c with SMTP id v11-20020a927a0b000000b00345db9abe2cmr14166003ilc.1.1688534432471; Tue, 04 Jul 2023 22:20:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688534432; cv=none; d=google.com; s=arc-20160816; b=h/dsdvYSiBRGsNkM83sIoXh9UOiXOJgvMFKustyGsrAS3od+LW+kdoSocOwVm9VVQ1 TCgPLkKHVcXlB1YUK9mQfuWP9biCOplCbMN337hQcqqsknSZuTqj3c2VAYrjF+XfBd1V 3++dL7hk0R7pEGuVT/H4kCYNQe0uinyunalKxb2orD45zYFmjXO2EQjSSir4R926+wT/ 2zu18z80W7CE6qVHsHtWVlh7poljVywydSFfIr62OfL9MUfqA00GKdlaYrBl3tkpwQS5 3Y6KvmR+iGRyIZi5QrWZU4abHgx8kQtKtOO+r+AEERAGpuZIVLAsENO8Jp6p8q3xbvtQ FyyA== 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=6s6V+yumbjVjoib/JBhJ6OMYboGlYd4KwAj+A8oW0bc=; fh=7+99jsykwvzeuFOnBt2NaL1XE9pkzAVZ/7Zpbd4QEkM=; b=lolAi8M/tZog8H0b8c/8DRfwHOde4tFVtlnsSKKvp4RuBMos6rdHPu61rAv48rsyKQ Ma+s/LECCifkTvPyinIzVXuuy67gfwban+1RYiATm+UgaaCdrPs0E/eBGNlP08ggYfmB SeAnu3eFBU9T1OrfF/YdTTrJy5zUMgelH8NyonoRRxZU7uY8yE9VbDQ8Izgv1MQcleHR yKpWn/41vt3w9bYJT1WWpCOf9DEFwmD7B8YtZVlY/3Elw+Dsr91/sRIJQCeRmEH/09FF FRw7zYUmZVpunIXT0GnY1fjvV89jeU9FqC90s+2AuLgPZExsmDsFFOPVl435h3e/kY6P kczw== 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 28-20020a63165c000000b0053ff4cf95bbsi22126744pgw.764.2023.07.04.22.20.08; Tue, 04 Jul 2023 22:20:32 -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 S229671AbjGEFOm (ORCPT + 99 others); Wed, 5 Jul 2023 01:14:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbjGEFOl (ORCPT ); Wed, 5 Jul 2023 01:14:41 -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 E032C1700 for ; Tue, 4 Jul 2023 22:14:40 -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 1qGuqc-0000A5-Jx; Wed, 05 Jul 2023 07:14:38 +0200 Date: Wed, 5 Jul 2023 07:14:31 +0200 From: Rouven Czerwinski To: Martin Kaiser Cc: 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: <20230705071431.7487e285@drumknott> In-Reply-To: <20230704170644.69669-1-martin@kaiser.cx> References: <20230704170644.69669-1-martin@kaiser.cx> 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: rcz@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 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 > --- > 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",