Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3753156pxb; Mon, 27 Sep 2021 01:33:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzI4JU6SNT5aU/b6bzPz2AEjEJdSF20XNjm3KHkRAdlPTxiJOslwgf0/jP3NA6tufXOD5Ja X-Received: by 2002:a17:906:3148:: with SMTP id e8mr25278154eje.240.1632731632045; Mon, 27 Sep 2021 01:33:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632731632; cv=none; d=google.com; s=arc-20160816; b=ulUkd6PraPIqkOqLHrJ2gkjWsfZLJhJKj7BFzqSyHPbApSZH34WN21dR9jk4sHQt1u FfrXvwXZfb+6HqDnORPF403IVjc3D1jkqJElQc6Uv0bCcx/DMaOPazTsTVffuKVt5JSV iSqk9zzP1BlPAKBwU10nPfFQFVBdJZ//ffarJdoZ3q8Y5KVmaILShWkx0UjU7dsnR18N ocnRxmQhJdR9pNeW9iFQk1cpDFegMoDKYogMezhMQEbAreOEPfhRFQeW0QmGX2RVAnFK blMd3ltYwsLSQkLBgOCyb7pHghDuPl5me6zDhfdAlRaUlM+gGT24UgjBBirBftfCRHmQ swgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=RXcIXxTv/c0sLfxQ2uHH7yTc99YOOZBVudfggVyvPA4=; b=tkTMG1C3J/y1yDfSr5jg3ZCcX2O6hygHIelVa/WipkXzwptq4nS9C2LkUPqHwV/OLy V9Vm/hlxhkfvwIQoSBRRbj0Pk747xhGnbZSUiWA9/dowUL8qET/dPFXtIoYvfd8KX3gI bsVSnnwv8bHI9AqExSjLaO3e4ZhUbSh3+Q0dzLNkjynlJh3fJXOTm+soBckf8rYkQlYe e9cotQikSLkJ9gp9UDnpUpdGJMvQfCg9idOUAOUQEqe+Duzh1HUUi/qP1sIO8rjPS1N4 mZ8DnkqD3jLewwArx5oc0C7f71OzCcPvSB+x3U7HAzooI+DU5cRMRUg8CNMWsDbC9zCe 1elQ== 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 eb13si9082773edb.334.2021.09.27.01.33.27; Mon, 27 Sep 2021 01:33:52 -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 S233491AbhI0IdH (ORCPT + 99 others); Mon, 27 Sep 2021 04:33:07 -0400 Received: from mx22.baidu.com ([220.181.50.185]:38158 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233417AbhI0IdB (ORCPT ); Mon, 27 Sep 2021 04:33:01 -0400 Received: from BC-Mail-Ex07.internal.baidu.com (unknown [172.31.51.47]) by Forcepoint Email with ESMTPS id C26F8183A0D47E84DEA2; Mon, 27 Sep 2021 16:14:37 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-EX07.internal.baidu.com (172.31.51.47) 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:14:37 +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:14:36 +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 1/9] iio: adc: ab8500-gpadc: Make use of the helper function dev_err_probe() Date: Mon, 27 Sep 2021 16:14:17 +0800 Message-ID: <20210927081426.762-1-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 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/ab8500-gpadc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/iio/adc/ab8500-gpadc.c b/drivers/iio/adc/ab8500-gpadc.c index 7b5212ba5501..c58d0e2ae538 100644 --- a/drivers/iio/adc/ab8500-gpadc.c +++ b/drivers/iio/adc/ab8500-gpadc.c @@ -1146,11 +1146,10 @@ static int ab8500_gpadc_probe(struct platform_device *pdev) /* The VTVout LDO used to power the AB8500 GPADC */ gpadc->vddadc = devm_regulator_get(dev, "vddadc"); - if (IS_ERR(gpadc->vddadc)) { - ret = PTR_ERR(gpadc->vddadc); - dev_err(dev, "failed to get vddadc\n"); - return ret; - } + if (IS_ERR(gpadc->vddadc)) + return dev_err_probe(dev, + PTR_ERR(gpadc->vddadc), + "failed to get vddadc\n"); ret = regulator_enable(gpadc->vddadc); if (ret) { -- 2.25.1