Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4941287pxb; Tue, 28 Sep 2021 07:22:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZqvN0ivEtJMlNH0zqonGieMfAz70ybedzJ09kgk6hqWcORo7iXlGfpIOJYbjAwB5ybic8 X-Received: by 2002:a17:906:2f94:: with SMTP id w20mr7256723eji.14.1632838922433; Tue, 28 Sep 2021 07:22:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632838922; cv=none; d=google.com; s=arc-20160816; b=lzTdzXMAbmZdRrREd/ifx8mtn1+P2t2HBV17ZPqflsNMYIfVTvM4gVEkXlccsy9qYa B5sdGyGk6+p3EPAdKLR+uaiIK6jdYwY3paucjKb//X+iKD7ofLJ7KLgQ217vIvj7xYT7 IFXSxaEcdGKElWgsRNxw9lp0KOskaeZWS1ruw6UDO4UNRNkZPiS5CIPqzOwHFqvSoIPr vT+FvOFGSyIwcz9kzGSAWCNgenWVtlZ60Saad3s/LE9VDhC+0qO0qxe0aamwRzv5woSl ++wjcqUXS6qb+WV2aTbBLQHZOU0Xu/fBgoqBWqExr/3lgQhalhiFtCxlCGMdmDF6K7iK I1iA== 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=289TNkTnTDKAPaeyw6sOtGUcELwIJ2YeoxKTFV2na6I=; b=fCJvY3u3XC0pS1ljYabThHfcZb69RNoOos4cGp9K2FK7ANVg68JVImgSdc5coRgsUg s7YS0FURpQGfuKDwuvJdm/7easJrxqrIeUYAcFmZ28AoX0g46dJohPI2l1UqCLhkc1EX /6IET1ssu2DO5a7XVVj/3vhsHzxuleEuzz16o/x+QKget0Bii2AhlXgoz/ciMHj/w+CZ prnWqQ+ipQ/sjuaSpaEO1NcZSl9LXKMINdJK4+4jF56jEQB1xB4YY4z+qbnN1SoqYHIz 02l1beC1c9DZTodTbBmn03lXmH30FMLDEIe6ATm3aNbxJ/7eMM3T6Eikhp22xf4JrWon /UQg== 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 5si23086354ejr.589.2021.09.28.07.21.32; Tue, 28 Sep 2021 07:22:02 -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 S240962AbhI1OVv (ORCPT + 99 others); Tue, 28 Sep 2021 10:21:51 -0400 Received: from mx22.baidu.com ([220.181.50.185]:48346 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233878AbhI1OVu (ORCPT ); Tue, 28 Sep 2021 10:21:50 -0400 Received: from BJHW-Mail-Ex08.internal.baidu.com (unknown [10.127.64.18]) by Forcepoint Email with ESMTPS id 0CEA2FD94BFD96959CDC; Tue, 28 Sep 2021 22:20:06 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BJHW-Mail-Ex08.internal.baidu.com (10.127.64.18) 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 22:20:05 +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 22:20:04 +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 v3 1/9] iio: adc: ab8500-gpadc: Make use of the helper function dev_err_probe() Date: Tue, 28 Sep 2021 22:19:47 +0800 Message-ID: <20210928141956.2148-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: BJHW-Mail-Ex13.internal.baidu.com (10.127.64.36) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) X-Baidu-BdMsfe-DateCheck: 1_BJHW-Mail-Ex08_2021-09-28 22:20:06:085 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. Reviewed-by: Linus Walleij 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