Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1498304pxb; Thu, 16 Sep 2021 08:41:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzg03q0SF9irrd+hXTyLZ9JuvVnU8EhY8JvzLWMMpks5jgsk3WD7yiSsW+Juob1+zxeQawQ X-Received: by 2002:aa7:c945:: with SMTP id h5mr7260379edt.350.1631806900654; Thu, 16 Sep 2021 08:41:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631806900; cv=none; d=google.com; s=arc-20160816; b=p8LNYBUd2TgsqYn7AvpsAA/tFru11fXWkFB0ur2epTiJ/bhK9fPihRVe6AjjJUm4Ck ASSw24eo7cC3+BB3keqCldITpBvb8zE9W6NXRQ+CWVEZfHrh1N3x+lqrGs7CI9WVlo6X c0l8L16vdOA7xYyokT1xIXd5vDtGQkR4F9puJYBfPlfJX5ngyw1Iz/QJPm/wQJeHMwXd q+HQDwyBhw3mydGFdDWJstzi2HODXM115dXOsmU8MRdz+Ns2OazSaCIbaplAkzAMD0Pm CeaM8QgymijNc1VM4zmqHUTsV5Gtxib5EyPrnDyVr+DAKrYgyF9fLoZVapP524NvmDYf xozw== 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=21LeIIoZuFoGuAEKjcMM0A4ksP/g1Iv1g7J7e0PHoEg=; b=l0/R5Tyx128hG6wNPZqsQiR4cg+ydXvIzoHF/F8l5bP9+sWAnQsVk8MZEkxGSGIzYh Mz8aewnVZq5xeCSA5dIJKeF3t5WlxiJqymP1zHcsdey9hjT6NS7EsY+uJJbA0WoesChP pfwMGXKxtt6DdF8PxVntD5W5D399m746xEvPMBa5i8DBc00UF85wpMQQOLAqJzXYazHp ivfdkl2t6P3JzCxubI8zC2kNApwP+S4lQTOoHcuze7V1Bcu9BlR5ZjJAqEorXKvEI1aP 26XYFTtpZFKs5CLhQz/5MDRcff9B+IrtXeD+0i4dFDS4Hx9Q8UnSux3y/XOrmw8hBTto kAAA== 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 p12si4877574ejy.596.2021.09.16.08.41.16; Thu, 16 Sep 2021 08:41:40 -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 S239382AbhIPPhw (ORCPT + 99 others); Thu, 16 Sep 2021 11:37:52 -0400 Received: from mx24.baidu.com ([111.206.215.185]:36928 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S238146AbhIPPht (ORCPT ); Thu, 16 Sep 2021 11:37:49 -0400 Received: from BJHW-Mail-Ex13.internal.baidu.com (unknown [10.127.64.36]) by Forcepoint Email with ESMTPS id 5D66053E3965FAC9A189; Thu, 16 Sep 2021 23:36:27 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BJHW-Mail-Ex13.internal.baidu.com (10.127.64.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 16 Sep 2021 23:36:27 +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; Thu, 16 Sep 2021 23:36:26 +0800 From: Cai Huoqing To: CC: Mark Greer , Krzysztof Kozlowski , , , Subject: [PATCH] nfc: trf7970a: Make use of the helper function dev_err_probe() Date: Thu, 16 Sep 2021 23:36:21 +0800 Message-ID: <20210916153621.16576-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-Ex09.internal.baidu.com (172.31.51.49) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) X-Baidu-BdMsfe-DateCheck: 1_BJHW-Mail-Ex13_2021-09-16 23:36:27:470 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/nfc/trf7970a.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c index 8890fcd59c39..8459a2735f2c 100644 --- a/drivers/nfc/trf7970a.c +++ b/drivers/nfc/trf7970a.c @@ -2067,8 +2067,8 @@ static int trf7970a_probe(struct spi_device *spi) trf->regulator = devm_regulator_get(&spi->dev, "vin"); if (IS_ERR(trf->regulator)) { - ret = PTR_ERR(trf->regulator); - dev_err(trf->dev, "Can't get VIN regulator: %d\n", ret); + ret = dev_err_probe(trf->dev, PTR_ERR(trf->regulator), + "Can't get VIN regulator\n"); goto err_destroy_lock; } @@ -2084,8 +2084,8 @@ static int trf7970a_probe(struct spi_device *spi) trf->regulator = devm_regulator_get(&spi->dev, "vdd-io"); if (IS_ERR(trf->regulator)) { - ret = PTR_ERR(trf->regulator); - dev_err(trf->dev, "Can't get VDD_IO regulator: %d\n", ret); + ret = dev_err_probe(trf->dev, PTR_ERR(trf->regulator), + "Can't get VDD_IO regulator\n"); goto err_destroy_lock; } -- 2.25.1