Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3743262pxb; Mon, 27 Sep 2021 01:18:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzujArfjy7AedloEwmz8vfLs4WxPYS3002mDyfhQdI5nQPaxD7Ucmr/3hEWjfj5+yVK1dCT X-Received: by 2002:aa7:df92:: with SMTP id b18mr21075224edy.47.1632730688271; Mon, 27 Sep 2021 01:18:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632730688; cv=none; d=google.com; s=arc-20160816; b=zEhdCfpEfWYEnVThJUEvbhtH5WtDLB9Ro7xPCnVbZ5xQyW94C8f1/LB2yyAHYhDBSo +bMxYkvcsqNMdWgO6FLKzeZMFrhLm81khbXYFC5SFsZed2TmEQ0RbH0NUxy6rKD8sX+P sBz2HeBTVoIFx2uddAf1QsgkVEmjJuKVwh49ykLAYfZRdEbvLywjROtHRCuoqK4sDIRe gtbCM441J5bMqRxkpaPsa9SubTK8UB6RoQtwNClLZKibkzxC+84LgBPkCcZ+jaUQan8d DLRDfx1hDYa1hU3TP+hbVXGPH8IjG6Vdl2WsGBvBfxoeu5jaHlZ44iYujE01CZb8fDM6 QqvQ== 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=eenHPGKy6Rhk+vxPpaYgmr9Zn5+Zylt0oPMecKPWfP0=; b=HeJYvct/8Qi2WNfPY1t5dX7tf7biRTqNV2s3apmntL0abMkEI6suzoewIrcpMIIgF8 c1ukatxtjvANVw24DiZshkdGLid34pCQXlSmExpyvfhc/Z8gVBeGrdvdS6CzB09wneX0 JW3lVy8osFEMLZ4l9vmcu19zvms69NYSZVI1eZ0Rk/ve7fUlERg1kNZzzJqCnae719fm mm96jDCLkttg3Ccb4+61XEuN7LfMQyvBvHY2RjyoeTQ1YHv9DOsDq4UXezhJyPY5X0zA ZJ8/HpggbDmKzcsHheS/fAeVQsMBFiCFDyJhnhgP99QlUly849EKanRzY4l0gIFoQB1P T5qw== 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 e8si17936965edv.247.2021.09.27.01.17.45; Mon, 27 Sep 2021 01:18:08 -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 S233443AbhI0IRO (ORCPT + 99 others); Mon, 27 Sep 2021 04:17:14 -0400 Received: from mx22.baidu.com ([220.181.50.185]:44912 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233422AbhI0IRL (ORCPT ); Mon, 27 Sep 2021 04:17:11 -0400 Received: from BC-Mail-Ex32.internal.baidu.com (unknown [172.31.51.26]) by Forcepoint Email with ESMTPS id B503F626B6D6940FE669; Mon, 27 Sep 2021 16:15:31 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex32.internal.baidu.com (172.31.51.26) 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:31 +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:30 +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 7/9] iio: adc: qcom-pm8xxx-xoadc: Make use of the helper function dev_err_probe() Date: Mon, 27 Sep 2021 16:14:23 +0800 Message-ID: <20210927081426.762-7-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/qcom-pm8xxx-xoadc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/iio/adc/qcom-pm8xxx-xoadc.c b/drivers/iio/adc/qcom-pm8xxx-xoadc.c index 0610bf254771..21d7eff645c3 100644 --- a/drivers/iio/adc/qcom-pm8xxx-xoadc.c +++ b/drivers/iio/adc/qcom-pm8xxx-xoadc.c @@ -910,16 +910,15 @@ static int pm8xxx_xoadc_probe(struct platform_device *pdev) map = dev_get_regmap(dev->parent, NULL); if (!map) { dev_err(dev, "parent regmap unavailable.\n"); - return -ENXIO; + return -ENODEV; } adc->map = map; /* Bring up regulator */ adc->vref = devm_regulator_get(dev, "xoadc-ref"); - if (IS_ERR(adc->vref)) { - dev_err(dev, "failed to get XOADC VREF regulator\n"); - return PTR_ERR(adc->vref); - } + if (IS_ERR(adc->vref)) + return dev_err_probe(dev, PTR_ERR(adc->vref), + "failed to get XOADC VREF regulator\n"); ret = regulator_enable(adc->vref); if (ret) { dev_err(dev, "failed to enable XOADC VREF regulator\n"); -- 2.25.1