Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3777293pxb; Mon, 27 Sep 2021 02:15:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyj6CWbr/pkxdLMu5oJZ+Ftw3rIg6550i7G5r9/NRkZvdND7xZTdU5eBFJ5wvocb3cDi0FT X-Received: by 2002:a17:902:7d95:b0:13d:a304:1b55 with SMTP id a21-20020a1709027d9500b0013da3041b55mr21594071plm.51.1632734129098; Mon, 27 Sep 2021 02:15:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632734129; cv=none; d=google.com; s=arc-20160816; b=JzeRoV04mx9K2HoLN9/CU6o4/nSt9hBkqzBYfRxuPqwhfhW9HUWZsx3/WiDlfljI8A NdT7TiKij6j+/XTER2nCshOLjTAP1FdoeXtiFFItxJIyqlbTqmy/uwyePbUi/cODTSbV Vv/bT7xREy8h47YK6M7iwcMqr1NTyQhr0iHCKQ0B60b8CLEr06/gzrUbvV+nWJCu7KJl kJz3GoDoNgwjqysUMJsRQ1jenrhZ44vL0ncBn+2pYE3HgJGqWzuPeonWAN1zp9zLnEpx jyx0xCkCaBqxQhFp0teQdC955Nw86HVpX3IJnAfokR/MivAGI3mLKzHfuZL50nf/yjtG htrQ== 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=E6MLQmr2U6E18tMwA5XCszYM+QBJnSc3M7NIMU3141eq7Wl+U3lRhDvBS2ZgaFzRgB QAYy6aSDjmX/sYGs6YE82X8OnObAba5x3pnU1ITZSsPjI2PfbSa4kYEkw3omf699+cBS emsj06sqpTjW+dStwNrw+lyn4doxOx1u0YoqOmzr5xXGOBZOZcxZkvss7bWUN+83B8HI x8/kPtG3SzkjQOdbdfGtjBahTgdRsdjrxPlputGQessvPl7eGkh2CUvR2TkQ/p1Y0ox2 PN0Gp40HE2xIkS1fFYlod6cmMMyvdR0JXHIDElkTiOTwoFGqBsNtF77tfq1E1sqPaROO otHA== 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 a3si19680333pgq.592.2021.09.27.02.15.16; Mon, 27 Sep 2021 02:15:29 -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 S233625AbhI0JPD (ORCPT + 99 others); Mon, 27 Sep 2021 05:15:03 -0400 Received: from mx24.baidu.com ([111.206.215.185]:32774 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233519AbhI0JPC (ORCPT ); Mon, 27 Sep 2021 05:15:02 -0400 Received: from Bc-Mail-Ex13.internal.baidu.com (unknown [172.31.51.53]) by Forcepoint Email with ESMTPS id 427D5A655954AD77177D; Mon, 27 Sep 2021 16:26:25 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by Bc-Mail-Ex13.internal.baidu.com (172.31.51.53) 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:26:25 +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:26:24 +0800 From: Cai Huoqing To: CC: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , "Vladimir Zapolskiy" , Marcus Folkesson , Maxime Coquelin , Alexandre Torgue , , , , Subject: [PATCH 3/8] iio: dac: ltc1660: Make use of the helper function dev_err_probe() Date: Mon, 27 Sep 2021 16:26:02 +0800 Message-ID: <20210927082608.859-3-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210927082608.859-1-caihuoqing@baidu.com> References: <20210927082608.859-1-caihuoqing@baidu.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BC-Mail-Ex15.internal.baidu.com (172.31.51.55) 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