Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4471708pxb; Mon, 27 Sep 2021 18:38:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHsivMgGTPbgF85LSeM0Ctt+sZG4B+t6hP+070cfUDj4OIxzEnPqbtDbP/gT/E6D+LwqkU X-Received: by 2002:a17:902:b583:b0:13d:e495:187a with SMTP id a3-20020a170902b58300b0013de495187amr2641139pls.9.1632793090517; Mon, 27 Sep 2021 18:38:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632793090; cv=none; d=google.com; s=arc-20160816; b=gvdlArXCq0sd7DlZYPOB83DFdXeyUgCJswB6N1SMpabhayb6D6EJX3E5Vg3Tew1PSn lER64S6BlJCFwOwER+m8gnK7lyi2Dtbi7t7jIHT6dKxhJ7Gpi78jxsyOfFl13IITpyzF f6J7CGD8K7w90ClqO0QJziUf03Q0RghgMfhUB7BuYSv76VpA/4XYaj5tdcBhmjESDQYI S6p6wpRnN5IyeDmSrr+yPuwqKASDXCFYPlfi1MSUgYRrh9OMRdk8RJNF523u2X1dZRsC 901jIg3DD9J0OAvrnH1APq16nhZdIcFiipi3MgnF7ng/0iqxGbINzpaEXnHUGbebMuWt 2pJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=F4bIGnwYmCEIfCYjd8cBl6IeofDSOElneHHm3Ari1O8=; b=wEmCZI3KTRNZTUwelixzt1hma/I1Rdd9+w0dyACFJzINjZdgy2VOMkOmulfyO612qt WJ7Y/2ul+YI7fMnnssDWI9Ox7gNYrwltdYmxIWvKAEihCNF73iTgClPd1Ef6xtnwQFYK ifpR7UHo/bK3QCy8zhQ9aHTPpJ7YsfpCiM8BOZRLI6kRrnneOaIs124+uhsoCahImf7R yDDMXyTEcmx4DCde+s7a2HObFPdFPYWZePWvE015nVt42OnwE8UkzMSiE7W3yrT8GrFp S6rYMbk+TunCfLJg9YQxOVxYhNoMiV1/5Tn6ZS2JfPaWZp3Ck5U2CBWXRIT3ut34E/Mk Pm5A== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d17si25053215pls.265.2021.09.27.18.37.44; Mon, 27 Sep 2021 18:38:10 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238428AbhI1BiY (ORCPT + 99 others); Mon, 27 Sep 2021 21:38:24 -0400 Received: from mx22.baidu.com ([220.181.50.185]:44710 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S238462AbhI1BiV (ORCPT ); Mon, 27 Sep 2021 21:38:21 -0400 Received: from BJHW-Mail-Ex13.internal.baidu.com (unknown [10.127.64.36]) by Forcepoint Email with ESMTPS id 8B054B521A39451A7D14; Tue, 28 Sep 2021 09:36:31 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BJHW-Mail-Ex13.internal.baidu.com (10.127.64.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Tue, 28 Sep 2021 09:36:31 +0800 Received: from LAPTOP-UKSR4ENP.internal.baidu.com (172.31.63.8) by BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Tue, 28 Sep 2021 09:36:30 +0800 From: Cai Huoqing To: CC: Linus Walleij , Jonathan Cameron , 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: [PATCH v2 1/9] iio: adc: ab8500-gpadc: Make use of the helper function dev_err_probe() Date: Tue, 28 Sep 2021 09:36:12 +0800 Message-ID: <20210928013621.1245-1-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BC-Mail-Ex24.internal.baidu.com (172.31.51.18) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) X-Baidu-BdMsfe-DateCheck: 1_BJHW-Mail-Ex13_2021-09-28 09:36:31:683 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- v1->v2: Remove the separate line of PTR_ERR(). drivers/iio/adc/ab8500-gpadc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/iio/adc/ab8500-gpadc.c b/drivers/iio/adc/ab8500-gpadc.c index 7b5212ba5501..c58d0e2ae538 100644 --- a/drivers/iio/adc/ab8500-gpadc.c +++ b/drivers/iio/adc/ab8500-gpadc.c @@ -1146,11 +1146,9 @@ static int ab8500_gpadc_probe(struct platform_device *pdev) /* The VTVout LDO used to power the AB8500 GPADC */ gpadc->vddadc = devm_regulator_get(dev, "vddadc"); - if (IS_ERR(gpadc->vddadc)) { - ret = PTR_ERR(gpadc->vddadc); - dev_err(dev, "failed to get vddadc\n"); - return ret; - } + if (IS_ERR(gpadc->vddadc)) + return dev_err_probe(dev, PTR_ERR(gpadc->vddadc), + "failed to get vddadc\n"); ret = regulator_enable(gpadc->vddadc); if (ret) { -- 2.25.1