Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4944178pxb; Tue, 28 Sep 2021 07:25:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiGxEhek1Pt5K5bOce9pZFmJTxyANKuEm3h7kEZbIPRmlr31aF4G7BnSdUfBXes2jPmst2 X-Received: by 2002:a17:906:144b:: with SMTP id q11mr7576108ejc.78.1632839135915; Tue, 28 Sep 2021 07:25:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632839135; cv=none; d=google.com; s=arc-20160816; b=MZdU/3twC8lwpvL+WyJRi1Cy4qc/RldnrXtI6XiBRtI1og6dZTCjAGK4j8xAXIhvle WRdr+bCzWLnMOzcXdFPH+Hky3gx83me8bqfqyPPWKJVLo0bjMJP1NyRdFA0F8QAcy4Qc pfPVO8MWjdjQ4XqHSS5dw5kD205vu3NHuQowa7vP1UyUasc8w2CQIqWyBNLCp0h4WAAh 7U1LTf2BX65P6LCGG7B7MXHj6mXgGluAdyXhbRHBeq84Nr+WEOsHzDLFtwmLrt694/LI XXGwbUC6P+GEwgD/NgodO8F+YtAcbFYmpKdD3hC05HDT31yMSRRVRG+yLNj2q6LwtHD4 nb9g== 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=bTrRwLgD9Eiade+MxGR3GQOpson4NFmhpdzlOfJJkpOywTmIyka1nUp5Wlj6/ARDE0 Eh9H1I8h0NpKJEYTuPdHwq3lW4dyJ0VpPDOksWACF5/Zd7xYJuww/1mVjgaRlEBid+Z9 hVRGUTB6NW0xxj4rxs3golVc7hs0zK1151l7+UAia5C3HtGExfjVxebYI1zq0gBEsDEP dJpze736rlo3ZmNooLEbn/dGg5q75VISERkWZr1dmQ4fYqFhYHZ82F3Wu7e2gT7LJEBc gmfE/8+4PTkxHknZyKgFv2X3rjatOsJUONuzZeWblmrs4vTIG28hS6wUp3Z2CnGnm3FB RCHg== 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 nb38si24568505ejc.126.2021.09.28.07.25.10; Tue, 28 Sep 2021 07:25:35 -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 S241308AbhI1OWW (ORCPT + 99 others); Tue, 28 Sep 2021 10:22:22 -0400 Received: from mx24.baidu.com ([111.206.215.185]:49274 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S241299AbhI1OWW (ORCPT ); Tue, 28 Sep 2021 10:22:22 -0400 Received: from BJHW-Mail-Ex12.internal.baidu.com (unknown [10.127.64.35]) by Forcepoint Email with ESMTPS id A8276E2D4722719671E6; Tue, 28 Sep 2021 22:20:41 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BJHW-Mail-Ex12.internal.baidu.com (10.127.64.35) 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:41 +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:40 +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 9/9] iio: adc: ti-ads7950: Make use of the helper function dev_err_probe() Date: Tue, 28 Sep 2021 22:19:55 +0800 Message-ID: <20210928141956.2148-9-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210928141956.2148-1-caihuoqing@baidu.com> References: <20210928141956.2148-1-caihuoqing@baidu.com> 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-Ex12_2021-09-28 22:20:41:697 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