Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4472565pxb; Mon, 27 Sep 2021 18:39:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwi3idLMinyByzystEHHv1hy62gciofyQjt4Bsm16fsRFax+4kNVyrz8Riu6to97wP62BrP X-Received: by 2002:a62:774b:0:b0:43c:36de:ed14 with SMTP id s72-20020a62774b000000b0043c36deed14mr2939738pfc.36.1632793186439; Mon, 27 Sep 2021 18:39:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632793186; cv=none; d=google.com; s=arc-20160816; b=qXWSNppfGYbektTgMgcGLitGgZopWIS5kD/T1wUsme5Jp2XX1LjSVgwZpXVm6beu6t l/jviol3f1Qma0VIGT3KkhmI17hlqPzMHKPI0zJExkX4vhLmGzNbzMKO/i8N3VufS64r SOZDmRgvMTZRuwJnDi2/jdup50fKcsl9OZ5P7dK8+PxnnshmjT/XKgCJYSmrFF17Kkd2 NDDtX/bkchPL69XNpaXa8vkPdK+cJ2j1LsN+2pf/Y/9IAgJ/1AS4CmstGrZSrZstddC/ Sx1Cl0s1OdU3VA5Q1Wvxpy8df4gYQggwMzP4yEA11Fnlm9dPC0zcFESlgyiWZLnh8iYM 8gPA== 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=kHEpR7NixQknmmgQV9MKBM+F5Vw/h8NYwboIUE0cfAjWuv2IML1E0+xF28HFWV37EQ t/SCIFYdonzLwup9tEBvoMe24zTenuoargKYpLhs1z7R7bZKa0NIQYouTiotYZocMNOV JkyqTSBjfo5NIbE8ohmXNsENgRDvmJ9nQH3twQMUpq3Ia+GSc+i7XS8Vv2g0ylLt53ft Zlwp/Ts1M0D1W3HQ2aiwEvU0o2TtF9vmi3p5Z0C77dq0dPEJCD4/d/AOqNmLsaeaSphu DttAnLEt/wPP7mXcyG/f7rGJMx9aFvrVMSqE/z5EM1e5zKEVNvxdm7zICwjpNnYoxhSf YOcw== 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 o13si1515097pji.10.2021.09.27.18.39.33; Mon, 27 Sep 2021 18:39:46 -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 S238569AbhI1Bix (ORCPT + 99 others); Mon, 27 Sep 2021 21:38:53 -0400 Received: from mx24.baidu.com ([111.206.215.185]:45800 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S238564AbhI1Bis (ORCPT ); Mon, 27 Sep 2021 21:38:48 -0400 Received: from BC-Mail-HQEX01.internal.baidu.com (unknown [172.31.51.57]) by Forcepoint Email with ESMTPS id 6CA739BC34D210442B7C; Tue, 28 Sep 2021 09:37:08 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-HQEX01.internal.baidu.com (172.31.51.57) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2242.12; Tue, 28 Sep 2021 09:37:08 +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:37:06 +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 9/9] iio: adc: ti-ads7950: Make use of the helper function dev_err_probe() Date: Tue, 28 Sep 2021 09:36:20 +0800 Message-ID: <20210928013621.1245-9-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210928013621.1245-1-caihuoqing@baidu.com> References: <20210928013621.1245-1-caihuoqing@baidu.com> 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) 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