Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1680232pxb; Thu, 7 Oct 2021 12:44:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmnp1Ixx6EsfGT2KHgAJYMw0SvW838cZQWWck+zSh5XYF3TldKS3TJ2iQ9qXk34wQ7+ux9 X-Received: by 2002:a63:720d:: with SMTP id n13mr1173488pgc.470.1633635852017; Thu, 07 Oct 2021 12:44:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633635852; cv=none; d=google.com; s=arc-20160816; b=tQNdcnDyl5013wnas6YPj41ZOb+CfnGlYdbLAttJ06GB1g1l/hxta7/fClHCMbkFHX /k55OyqE9HSfhm/huCNuuRE5J/BHoSqa8q/5GQuIK9W4EkxgLEB7Iu32/AWebZW6sj+M i3RWeDOkgAcd0Z2vFOcfnPjuWWTSvbVNLG3oJlnTE/RdTHdzMDx6TsBvVmQ3qmOitlcH r9BxXib94HeHbzqjm5VKk+qTcEV7d2FogXf01nVXecJzaeqjx3hq0AahRsKLMfyoRtS0 bq+qHDCw5s7OKOolMTncVq4TBpWUWhwLoi2GrFraPwEiWJl459moPwhVdsbTfJVbdKB8 Ghgg== 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=dooLVdBIydCXTLkO8Qs0rY+RbMz0xMf8HPL334LSXCo=; b=PBt/XRYORiJmdR6qDcxEtTEk4cZua2tK6CxbGaYd0BzO3ocF7Rxny6HkQbCfm1j7s7 A3XvcciV46QKlBey6aSQuozE3nA9jsuOXalbP9WMpbeyqr8Ai5dN1+khhuOwytubVsqc aAUlNro8bkEGB6lfsT4jLTvfBss3DGwtSLbEFueQfBw9OYn7beMtJkIko4mocstRF+jI xFrcwhJ0TVyLzITdtoHiOdpnqwYJo4Y9PnbKk34sMXFOsOL5DOxdkDrgs+7VSWf3V/es npLshc2Slqymq+KlSLkHjuUxZGgH5HUeE/2Gg6/jPvKvGa6aJemZV3VRqtP3vW3tSgii HB1Q== 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 c13si8290509pfd.336.2021.10.07.12.43.59; Thu, 07 Oct 2021 12:44:12 -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 S242457AbhJGRbe (ORCPT + 99 others); Thu, 7 Oct 2021 13:31:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:54442 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242353AbhJGRba (ORCPT ); Thu, 7 Oct 2021 13:31:30 -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 ED31360BD3; Thu, 7 Oct 2021 17:29:34 +0000 (UTC) Date: Thu, 7 Oct 2021 18:33:38 +0100 From: Jonathan Cameron To: Cai Huoqing Cc: Lars-Peter Clausen , , Subject: Re: [PATCH v2 1/2] iio: health: afe4403: Make use of the helper function dev_err_probe() Message-ID: <20211007183338.37c80008@jic23-huawei> In-Reply-To: <20210928014403.1563-1-caihuoqing@baidu.com> References: <20210928014403.1563-1-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 09:44:01 +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 Series applied and pushed out as testing for 0-day to see if it can find anything we missed. Thanks, Jonathan > --- > v1->v2: Remove the separate line of PTR_ERR(). > > drivers/iio/health/afe4403.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/iio/health/afe4403.c b/drivers/iio/health/afe4403.c > index d4921385aaf7..3a8cfb669b25 100644 > --- a/drivers/iio/health/afe4403.c > +++ b/drivers/iio/health/afe4403.c > @@ -487,10 +487,10 @@ static int afe4403_probe(struct spi_device *spi) > } > > afe->regulator = devm_regulator_get(afe->dev, "tx_sup"); > - if (IS_ERR(afe->regulator)) { > - dev_err(afe->dev, "Unable to get regulator\n"); > - return PTR_ERR(afe->regulator); > - } > + if (IS_ERR(afe->regulator)) > + return dev_err_probe(afe->dev, PTR_ERR(afe->regulator), > + "Unable to get regulator\n"); > + > ret = regulator_enable(afe->regulator); > if (ret) { > dev_err(afe->dev, "Unable to enable regulator\n");