Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp777379pxb; Wed, 29 Sep 2021 09:26:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6CCb6j9sdGo+1m/SsaUz6Tfs/ar/whn/W6b0ECbMjf6NfqaZKl0aoKcIjFMKNhzEtjfJh X-Received: by 2002:a17:906:3fc1:: with SMTP id k1mr776728ejj.44.1632932801326; Wed, 29 Sep 2021 09:26:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632932801; cv=none; d=google.com; s=arc-20160816; b=Qxt0oqwe/Kp0fgedf526XBUhtgy4xlpNUqAXkDIxVYcz7uIIkuP5BQxB8ghXpVH0Zl YSFTjW8x+VbsaEOA8NDXFzzTbm0YK8dsJwwKhcheKrUZopC2+0jehbLxx6NTHU1TxhE5 UBKEOEGEbi/42jBl5nCSiN5CQ8CZ3sfFG+Gp+fS1txsetshwbEbU0AJah5KcX5Wr117i +nD0YT0okX0dBBy60VG5jnl7u8HudSiqp9dRz/jlvsJlGFe/ECSWQTA2uWgx9qBpAbty WN22elZ9YkRlB/JY5nfRh/L4fGarh6zkIsvxQ7pzpvVi2nihDeLbFw4Kz4liPWQUxJ9d guUQ== 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:subject:cc:to:from:date; bh=h4Yr9XZJl2XXe+6uAFIUHYsFCUE0tFmtfugNuSCshHk=; b=carZZTRZo0SMcJkUR1JXRDXQcLFMxqgX//ATwNSzyvn2l2W5cUkHGsdqVFe5Rftddt IswxYHej3sS8p7GrP9z5sNulknrLySvyi2t+0IdJ5SEXfJNFn2EVD2EZGoRY3i4rJxvc BtsdevwwlzOsS8XZks8sXGmuE8YkMJgIvmFUtAwtVLD0bf3AwTyzZCct7ZcvGH9wZmr1 bo9qvn3adyWVGVlFe3QXuhvugWVD1aiJvPPqzilauFxgvHbOHVGsILJOhtY8iiDkgu/4 ef9yR4dwUN8/ztmqTcrj2DQW4IUT21B6i09qZufUYawWQfnfnLPFgVnldwKbGgdC3b4y IlSw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v2si463125edc.561.2021.09.29.09.26.17; Wed, 29 Sep 2021 09:26:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344466AbhI2QYU (ORCPT + 99 others); Wed, 29 Sep 2021 12:24:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:33308 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344369AbhI2QYT (ORCPT ); Wed, 29 Sep 2021 12:24:19 -0400 Received: from jic23-huawei (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 275C461246; Wed, 29 Sep 2021 16:22:32 +0000 (UTC) Date: Wed, 29 Sep 2021 17:26:27 +0100 From: Jonathan Cameron To: Cai Huoqing Cc: Linus Walleij , Lars-Peter Clausen , Shawn Guo , Sascha Hauer , "Pengutronix Kernel Team" , Fabio Estevam , "NXP Linux Team" , Vladimir Zapolskiy , "Neil Armstrong" , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Andy Gross , "Bjorn Andersson" , Heiko Stuebner , , , , , , Subject: Re: [PATCH v3 2/9] iio: adc: imx7d_adc: Make use of the helper function dev_err_probe() Message-ID: <20210929172627.1dfd4f17@jic23-huawei> In-Reply-To: <20210928141956.2148-2-caihuoqing@baidu.com> References: <20210928141956.2148-1-caihuoqing@baidu.com> <20210928141956.2148-2-caihuoqing@baidu.com> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 28 Sep 2021 22:19:48 +0800 Cai Huoqing wrote: > When possible use dev_err_probe help to properly deal with the > PROBE_DEFER error, the benefit is that DEFER issue will be logged > in the devices_deferred debugfs file. > Using dev_err_probe() can reduce code size, and the error value > gets printed. > > Signed-off-by: Cai Huoqing Hi Cai, It is currently not printing a message, but should we handle the same for platform_get_irq? One other minor comment inline. Actual change here is fine. Thanks, Jonathan > --- > drivers/iio/adc/imx7d_adc.c | 16 +++++----------- > 1 file changed, 5 insertions(+), 11 deletions(-) > > diff --git a/drivers/iio/adc/imx7d_adc.c b/drivers/iio/adc/imx7d_adc.c > index 4969a5f941e3..f47360cbff3b 100644 > --- a/drivers/iio/adc/imx7d_adc.c > +++ b/drivers/iio/adc/imx7d_adc.c > @@ -496,19 +496,13 @@ static int imx7d_adc_probe(struct platform_device *pdev) > return irq; > > info->clk = devm_clk_get(dev, "adc"); > - if (IS_ERR(info->clk)) { > - ret = PTR_ERR(info->clk); > - dev_err(dev, "Failed getting clock, err = %d\n", ret); > - return ret; > - } > + if (IS_ERR(info->clk)) > + return dev_err_probe(dev, PTR_ERR(info->clk), "Failed getting clock\n"); Where it doesn't hurt readabilty preferred to keep below 80 chars. > > info->vref = devm_regulator_get(dev, "vref"); > - if (IS_ERR(info->vref)) { > - ret = PTR_ERR(info->vref); > - dev_err(dev, > - "Failed getting reference voltage, err = %d\n", ret); > - return ret; > - } > + if (IS_ERR(info->vref)) > + return dev_err_probe(dev, PTR_ERR(info->vref), > + "Failed getting reference voltage\n"); > > platform_set_drvdata(pdev, indio_dev); >