Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3743351pxb; Mon, 27 Sep 2021 01:18:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1yZs7qlRI2VXGlCk1PVNEEyCMJCkTzApi3Xext+3sU011m0Rk3vMpbFz5dESAMqQI3iFO X-Received: by 2002:a17:906:3596:: with SMTP id o22mr12273056ejb.356.1632730694546; Mon, 27 Sep 2021 01:18:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632730694; cv=none; d=google.com; s=arc-20160816; b=bIHpHaLosCF6MYTki+PLEUBTW2BYE5f7VFt/0MZcceBaVWmVJ9ZhXTohsWptrV+7Im 4d17OyprnCWj0Jgw+MhGOF7gjO89FqMJqCHmScCXp7DYalqFbgpbnGlgVAuKJ+PhbWEI jBTMpX/SGi9Wxwj7sbAN8+IZfE/hUxJ4T8IrsXvn9ymhT5MLtDM5WpZ559FRlNjtmpFy OrcTn32bZnQMUM1u8LfO1ihVRzvNQBUbqtP79ex/6P8WvN5VHtWnCCbylEPJrUS65i8R SGvS+3gXGXuhGiU4kFLQup0oRYQo+glRS+a+akwAO+/Qc59oo7eprWRic3yXV6ygUCZF PJSw== 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=jKJk6MTWqYoWqZJPuxdIs5RjIE2k/gpR75O1+v42uG1X/S2QUS+aJjvDlbf7hqzo2z 9yPB/DNegLjk4SH6lgjJhlbazwITYxHC5Z8w6N+Uf6TwzPORBxx1hYpbkACQoNX7b0WH 28murB8wWv20t3/XdxbT0CrP9VAHW1urVqFzGyTXy3M5/oE7ky/c6Y6NUf5Co63AJpTg cY+jkk3tK2Rv1bLgemABrdyxS2vYS1Ju6doLFKPZk/8sgF6PGM0HanAvJ6aHwNZm8XA+ ef2k/rJkxy2mJ+v6v0WhyRbJEewO7zlKhdkN7bRyegLxgFPGAxS7SN5+VTpWzGZOGpal 3A/g== 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 ds17si22441936ejc.79.2021.09.27.01.17.51; Mon, 27 Sep 2021 01:18:14 -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 S233489AbhI0IRT (ORCPT + 99 others); Mon, 27 Sep 2021 04:17:19 -0400 Received: from mx24.baidu.com ([111.206.215.185]:45084 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233455AbhI0IRR (ORCPT ); Mon, 27 Sep 2021 04:17:17 -0400 Received: from BC-Mail-Ex30.internal.baidu.com (unknown [172.31.51.24]) by Forcepoint Email with ESMTPS id 5F1E613263E441E52F68; Mon, 27 Sep 2021 16:15:38 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex30.internal.baidu.com (172.31.51.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2242.12; Mon, 27 Sep 2021 16:15:38 +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; Mon, 27 Sep 2021 16:15:36 +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 9/9] iio: adc: ti-ads7950: Make use of the helper function dev_err_probe() Date: Mon, 27 Sep 2021 16:14:25 +0800 Message-ID: <20210927081426.762-9-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210927081426.762-1-caihuoqing@baidu.com> References: <20210927081426.762-1-caihuoqing@baidu.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BC-Mail-Ex10.internal.baidu.com (172.31.51.50) 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