Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4471982pxb; Mon, 27 Sep 2021 18:38:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyV8hqAme/8VyXzeQXZeSF1FVzxUc9kWTfU1GgRPL3rK6bYQw2e0CKBWqE8+12eA0MZvhPj X-Received: by 2002:a63:e64a:: with SMTP id p10mr2265409pgj.263.1632793119229; Mon, 27 Sep 2021 18:38:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632793119; cv=none; d=google.com; s=arc-20160816; b=ej8yEcy2Pw91UMHgrRE/K3mFOYUBiLsZpwl2cO9XTwe5sZ8qcCeV0z1h4rWyZCdSif vy2+B623oWjXLlzuYBA99O4nEeGfrOY9kG/cG17w5SwaAXBI4BjCuz/ViOGsYYI0DegP fHE6tgE1NEAdlcIho64eBtkdYcw/3deDRxO652iVG04BBlnr6c23qNMPbBhxv9TWRLUd UdhnmAixUCliBPrIJFnPIBIvgFgvtbju97Gs7LV0BLmqlzccLmLsFPeFNGu54evfB/iU 2aPsHYCnVjweaIs/l3PAim5PGJCZYgkltQmaDrkPlo1yyU4uy1gShro3ifhCW9MwmyBm X82Q== 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=/nbZzK/9QXI7/aPLL6eooNivfHjOElIn00MJQqo9b7k=; b=xevajgcVeV7v31dfCXGLkZoCgTD9CMjgvYvtycu/ojM9Q95OcKhlgOg7XxIauk30ID jCXD3wxITkoLBJFjiMYLi85q1nABgaGRwbFRUobtk477FFHbl6GbOF3Oswtyahtjxwke JCZ9gQyFEZIHqryZNgQDsdUGCGrHzV2DT5aTpFtIj7bvlMUjmL4ZChgmoVrLlSKxEXzW gaiskh2gJ3D+x38tSJbsHjB5YZ5ufP8Gcy+J221brnaePJoLpvGfiRM/b3DnW5+1A5o6 bkfqf0HSu3JjIAMkSvsmHzW2evuG9lg9DVVyvVhxIyECz8hReNMuGcEFrdhJScXCI53W G5QA== 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 s1si1399367pjz.100.2021.09.27.18.38.27; Mon, 27 Sep 2021 18:38:39 -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 S238559AbhI1Biq (ORCPT + 99 others); Mon, 27 Sep 2021 21:38:46 -0400 Received: from mx22.baidu.com ([220.181.50.185]:45636 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S238507AbhI1Bin (ORCPT ); Mon, 27 Sep 2021 21:38:43 -0400 Received: from BC-Mail-HQEx02.internal.baidu.com (unknown [172.31.51.58]) by Forcepoint Email with ESMTPS id 9B538E798815F5D9CB61; Tue, 28 Sep 2021 09:37:03 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-HQEx02.internal.baidu.com (172.31.51.58) 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:37:03 +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:37:02 +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 v2 8/9] iio: adc: rockchip_saradc: Make use of the helper function dev_err_probe() Date: Tue, 28 Sep 2021 09:36:19 +0800 Message-ID: <20210928013621.1245-8-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210928013621.1245-1-caihuoqing@baidu.com> References: <20210928013621.1245-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 --- v1->v2: Remove the separate line of PTR_ERR(). drivers/iio/adc/rockchip_saradc.c | 8 +++----- 1 file changed, 3 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,9 @@ 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