Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3743022pxb; Mon, 27 Sep 2021 01:17:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCCp3oIRIUYmnoyT4hxaHKpRpQY1YZvL0k3p5Uy3A0iC1mjS3pZ4FYQcCuvl6Ol5wKXMCs X-Received: by 2002:a17:907:7f8e:: with SMTP id qk14mr2184939ejc.91.1632730666830; Mon, 27 Sep 2021 01:17:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632730666; cv=none; d=google.com; s=arc-20160816; b=Yb8sH1E1V1corsuXA6tZLekIAhhVxZ0GZPkMRIeEZUa0y0L+FtLZJ0eiHV1JLnfEFy U4qVsHCZkxw+XCII2hzhpGmsJgz2wb6PU4eTPYVShWsn3UVufsr7d2bdrNlcxZsW1Lpz PNH9WA7pNFLQUdKnNjeNZ2L08ClQdtdoiyo1peDzplozde/AJc6WEfO71xM57pA7lTo3 O0U5VYPzRW56vU8wtu59IXcOiNrN4Gc1DxvvMEcwgAS4Guni5EgshfQY27e5vZtfkZzv FwSyUqH6S2e8T/2W0zDJGXa6tUDwVPGFNwY8MDHSAN9+ZmXvNMqmz6KyyJjiXVrM5h7N ti8A== 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=qgqT/QvLJM0oKb3Hd7f6TZcKmQp3Q45vvdUmI8T2JDE=; b=QO2M+xdsXj3xMHYYdvLdiyzzXABq9GSHEQ1qLp6VJp7A/T3RP2heT4nMxCSRsLULg5 CepVZrlrSw42/wTWlmNvQhgvsRKSz1xjMB4OvFY+XychIKKr3ecapBv/1OwzPTVfFDr/ gBQ9hzoW4eWPr5q6+eWq/th79/sMbZGU6/eky+BmW+hlUt+8AYEyUs84p1WAaE8N2P6O e+wq8sCsVH6qouTrIbTt4chLOYAdkJp1hSPkazgvmhBNrB2MWWBJOAsrrMJ+SP9kZkT3 bNFjRYgZBG4Ta9yWpxgwwlMQ/up9dQiZ/ZTDBMiZCJnE8a0cII+R2z2sU9mLFx2CaxaV 6KSw== 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 r23si17361036eda.597.2021.09.27.01.17.23; Mon, 27 Sep 2021 01:17: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 S233467AbhI0IRR (ORCPT + 99 others); Mon, 27 Sep 2021 04:17:17 -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 S233450AbhI0IRO (ORCPT ); Mon, 27 Sep 2021 04:17:14 -0400 Received: from BC-Mail-Ex31.internal.baidu.com (unknown [172.31.51.25]) by Forcepoint Email with ESMTPS id EA99EBA5509B56E1DD20; Mon, 27 Sep 2021 16:15:34 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex31.internal.baidu.com (172.31.51.25) 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:34 +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:33 +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 8/9] iio: adc: rockchip_saradc: Make use of the helper function dev_err_probe() Date: Mon, 27 Sep 2021 16:14:24 +0800 Message-ID: <20210927081426.762-8-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/rockchip_saradc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/iio/adc/rockchip_saradc.c b/drivers/iio/adc/rockchip_saradc.c index a56a0d7337ca..57419ccb3c70 100644 --- a/drivers/iio/adc/rockchip_saradc.c +++ b/drivers/iio/adc/rockchip_saradc.c @@ -392,11 +392,10 @@ static int rockchip_saradc_probe(struct platform_device *pdev) } info->vref = devm_regulator_get(&pdev->dev, "vref"); - if (IS_ERR(info->vref)) { - dev_err(&pdev->dev, "failed to get regulator, %ld\n", - PTR_ERR(info->vref)); - return PTR_ERR(info->vref); - } + if (IS_ERR(info->vref)) + return dev_err_probe(&pdev->dev, + PTR_ERR(info->vref), + "failed to get regulator\n"); if (info->reset) rockchip_saradc_reset_controller(info->reset); -- 2.25.1