Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4481878pxb; Mon, 27 Sep 2021 18:56:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9WlWWuac7bnIp5KJ3an0Swuri9sGg4+tQCBahPTRDn/ZtvOzFXPhFNWPiq1Q4gNYy283e X-Received: by 2002:a17:902:eaca:b0:13e:276d:7b24 with SMTP id p10-20020a170902eaca00b0013e276d7b24mr2802424pld.4.1632794191593; Mon, 27 Sep 2021 18:56:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632794191; cv=none; d=google.com; s=arc-20160816; b=VTf7+mFmNunQiSwfIzpMWRIARGp5/g4zE3w0odwAIVk0Q70prwU0fArz9KhD8wHNTt PW2FpUN3wV3BkWcgWv0VjF6LTm8wLwsU7/yiyqinKF7ZR9+E6PAn8mZCA4Vb+jTovDyn GLExR7/iScbOSBvyZWErxNM+J79UBE4lw1a8D3xCZmHGSYMfgyJ6bMBDMoj72+daXNvW ljj56Xc3NevZru0b2k1qJLvHeQLAK0LVHV0b2ExPx5W6KeQCbUmkYQLwK7rBBa2y2/8v 9OMObRHMUKkJW4+HTViemaOZQ/yWzTEZVgoIohneABUeRiaKdrvSumGQXaz9KT42emgz 3ooQ== 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=FCVxLC4XSfpal0ZrfWDiD99onPculLylEEf9hG1/cfo=; b=dqp0vObabt/IA0uZHfPUAPVq1eY5eiQYdajup63oSvdeW4F6gHDpOZDyKlyM0iRiOz PpDK1QyHu1jNyIYKSm3jOVWwbvHwaWz6H4FKsvCLRvAPG9OO5P3+Gib82+F391gBQPWZ YVymVvjSYjlV9Cs40R9UuWWrUz444oW5djCiprfQrTjW+M38EHuw/d8JEltp7Nda3RRk YLS7dRcDgqjiG0lX75ZVom/w+/ICdeji/7gurAl0yvdAeGze1WEsCu6X8AOiw1iGmf2Y cBQbB1qM1sA5UwWLdc0wpPErPhXxBorZeAHw35sh7i09qbp2w9/f7fmTpO66ZSJXYrfY Mg0A== 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 f15si5471454pln.345.2021.09.27.18.56.18; Mon, 27 Sep 2021 18:56:31 -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 S238497AbhI1B5N (ORCPT + 99 others); Mon, 27 Sep 2021 21:57:13 -0400 Received: from mx24.baidu.com ([111.206.215.185]:34296 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S238453AbhI1B5L (ORCPT ); Mon, 27 Sep 2021 21:57:11 -0400 Received: from BC-Mail-Ex09.internal.baidu.com (unknown [172.31.51.49]) by Forcepoint Email with ESMTPS id D3A34EAE8B5EBB748EA0; Tue, 28 Sep 2021 09:39:18 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex09.internal.baidu.com (172.31.51.49) 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:39:18 +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:39:17 +0800 From: Cai Huoqing To: CC: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , "Vladimir Zapolskiy" , Marcus Folkesson , Maxime Coquelin , Alexandre Torgue , , , , Subject: [PATCH v2 3/8] iio: dac: ltc1660: Make use of the helper function dev_err_probe() Date: Tue, 28 Sep 2021 09:38:56 +0800 Message-ID: <20210928013902.1341-3-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210928013902.1341-1-caihuoqing@baidu.com> References: <20210928013902.1341-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/dac/ltc1660.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/iio/dac/ltc1660.c b/drivers/iio/dac/ltc1660.c index dc10188540ca..f6ec9bf5815e 100644 --- a/drivers/iio/dac/ltc1660.c +++ b/drivers/iio/dac/ltc1660.c @@ -172,10 +172,9 @@ static int ltc1660_probe(struct spi_device *spi) } priv->vref_reg = devm_regulator_get(&spi->dev, "vref"); - if (IS_ERR(priv->vref_reg)) { - dev_err(&spi->dev, "vref regulator not specified\n"); - return PTR_ERR(priv->vref_reg); - } + if (IS_ERR(priv->vref_reg)) + return dev_err_probe(&spi->dev, PTR_ERR(priv->vref_reg), + "vref regulator not specified\n"); ret = regulator_enable(priv->vref_reg); if (ret) { -- 2.25.1