Message ID | 20211008092858.495-9-caihuoqing@baidu.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=yw6d=O4=lists.infradead.org=linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA0F6C433F5 for <linux-amlogic@archiver.kernel.org>; Fri, 8 Oct 2021 09:33:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8DD6460FDC for <linux-amlogic@archiver.kernel.org>; Fri, 8 Oct 2021 09:33:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8DD6460FDC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baidu.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eEura9UTHd3RYfv1qQAIVIM4HkMmVt5JfoiKMa+qnWs=; b=ey49TSRC8YxS+o SIx+Jex9klN8G+pa1wAxlKZhAV2Ff4FUZwU3laipKpVhc/7JdngskrBmKg+7UBe4E6lZ0hl5V33Gl HLXm3J/s/eS58nwtXSiBLmvMWCUvJSdl2AEzs6gzCgk/r8dsDX/enPv5frPRnMJOi6qjiXI4ZgoKm G0aIn7AS5IbrvULBRK72xW4KSewp3Kt8weJVG3HrGfROtCj/spgc9gt8TlPHgAH99jrGAv/aYQFiV seRcRSyG91EcgGSqut8bl0/wah1KD9DrMYiUXPh2CtDGaohPNdM5mt2Jg95qKTmgEjtczdhU99fz0 W19pm8EyzQqQgnK5CkMg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mYmFc-002DqV-2r; Fri, 08 Oct 2021 09:33:12 +0000 Received: from mx24.baidu.com ([111.206.215.185] helo=baidu.com) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mYmBx-002Bk4-0L; Fri, 08 Oct 2021 09:29:26 +0000 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 <caihuoqing@baidu.com> To: <caihuoqing@baidu.com> CC: Linus Walleij <linus.walleij@linaro.org>, Jonathan Cameron <jic23@kernel.org>, Lars-Peter Clausen <lars@metafoo.de>, Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>, "Pengutronix Kernel Team" <kernel@pengutronix.de>, Fabio Estevam <festevam@gmail.com>, "NXP Linux Team" <linux-imx@nxp.com>, Vladimir Zapolskiy <vz@mleia.com>, "Neil Armstrong" <narmstrong@baylibre.com>, Kevin Hilman <khilman@baylibre.com>, Jerome Brunet <jbrunet@baylibre.com>, Martin Blumenstingl <martin.blumenstingl@googlemail.com>, Andy Gross <agross@kernel.org>, "Bjorn Andersson" <bjorn.andersson@linaro.org>, Heiko Stuebner <heiko@sntech.de>, Philipp Zabel <p.zabel@pengutronix.de>, <linux-arm-kernel@lists.infradead.org>, <linux-iio@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-amlogic@lists.infradead.org>, <linux-arm-msm@vger.kernel.org>, <linux-rockchip@lists.infradead.org> 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 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) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211008_022925_260929_98B1DEB9 X-CRM114-Status: UNSURE ( 9.94 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-amlogic.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-amlogic>, <mailto:linux-amlogic-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-amlogic/> List-Post: <mailto:linux-amlogic@lists.infradead.org> List-Help: <mailto:linux-amlogic-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-amlogic>, <mailto:linux-amlogic-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" <linux-amlogic-bounces@lists.infradead.org> Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org |
Series |
[v4,1/9] iio: adc: ab8500-gpadc: Make use of the helper function dev_err_probe()
|
expand
|
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; }
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 <caihuoqing@baidu.com> --- drivers/iio/adc/ti-ads7950.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)