Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2178933pxb; Fri, 8 Oct 2021 02:32:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhfl0F1DURKeFp5XVIVNLa6s+aTPklA/J2P7QA235yFzyRGWUUoHkKVXNJk2if6d1Iuvxc X-Received: by 2002:a63:d64c:: with SMTP id d12mr3861395pgj.186.1633685543838; Fri, 08 Oct 2021 02:32:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633685543; cv=none; d=google.com; s=arc-20160816; b=WB61wbWhge4UitfSIKVllEOuih7G7jKNBtlctXCLNyR3CT+WObEJfIa1SqV151I/jS N7n2/zg3ekGHRyVKVpRknOxjVeXzJ8tL6Ua7b3G19GWId88KRPVczVrcMUpVdmUwzZb0 sq/iPZcYOHy+jqxtqAtBhqRXRhFA8exTahs8Ux1hEA7iPlfGUnQJmP1lIKIkAR9Y3IXI PEvdtZoy3d7t+PIjQbB5lMRY0rE5YtVqhslzq8HqBoOvJU5SHkJ6KXaDPKU8/SOQAvzl mT/XOfCMulDP4X06u04I+ytCnz4VJ5gmG3Ovu+kncLtG+QEipEI7JhNJ82pSyCMCOvuZ n30g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=6nEn6dZnRb4hBpNhBVV/eXaY5QR96rlwvpIifdDuloo=; b=WGuxy4faQldurbBJtUNfMmPg5XLIPvV6z2UZZdCkiFJAy3aUQE/1DitW2wbxPLk28u VnhFkw0SRloQd4rPR8JycwE/Wx1NA4mNM91mdhwL+FnmKOCAK+7FefYqxSiyhMYPXUc6 zVGghyPPNSVvn0iTMwnNWy3ExC0CX0z4h5tgqGQTvGdq7d3L3iueGdFpOhg6wdRIrxWj b/5mvNhAa6er3yTNbQIjCdPZugT2NpK74SpnZpVlWmOhRaPoUqQb+oUU+ipb4I5U9k+V pwamaG31ZHrL2qmJvnPh6jME65zQsp6qN0cxgeGRiS/zzsAFwErKJWOKKqMWiaQ7Zb43 Yg8w== 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 a3si2600912pls.163.2021.10.08.02.32.07; Fri, 08 Oct 2021 02:32:23 -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 S239538AbhJHJbb (ORCPT + 99 others); Fri, 8 Oct 2021 05:31:31 -0400 Received: from mx24.baidu.com ([111.206.215.185]:38634 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S238481AbhJHJbU (ORCPT ); Fri, 8 Oct 2021 05:31:20 -0400 Received: from BC-Mail-Ex16.internal.baidu.com (unknown [172.31.51.56]) by Forcepoint Email with ESMTPS id F122AE56AD15C4B3F2E6; Fri, 8 Oct 2021 17:29:23 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex16.internal.baidu.com (172.31.51.56) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2242.12; Fri, 8 Oct 2021 17:29:23 +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; Fri, 8 Oct 2021 17:29:22 +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 , Philipp Zabel , , , , , , Subject: [PATCH v4 9/9] iio: adc: ti-ads7950: Make use of the helper function dev_err_probe() Date: Fri, 8 Oct 2021 17:28:57 +0800 Message-ID: <20211008092858.495-9-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211008092858.495-1-caihuoqing@baidu.com> References: <20211008092858.495-1-caihuoqing@baidu.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BC-Mail-Ex14.internal.baidu.com (172.31.51.54) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) 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 --- drivers/iio/adc/ti-ads7950.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/ti-ads7950.c b/drivers/iio/adc/ti-ads7950.c index a2b83f0bd526..a7efa3eada2c 100644 --- a/drivers/iio/adc/ti-ads7950.c +++ b/drivers/iio/adc/ti-ads7950.c @@ -600,8 +600,8 @@ static int ti_ads7950_probe(struct spi_device *spi) st->reg = devm_regulator_get(&spi->dev, "vref"); if (IS_ERR(st->reg)) { - dev_err(&spi->dev, "Failed to get regulator \"vref\"\n"); - ret = PTR_ERR(st->reg); + ret = dev_err_probe(&spi->dev, PTR_ERR(st->reg), + "Failed to get regulator \"vref\"\n"); goto error_destroy_mutex; } -- 2.25.1