Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1494856pxb; Thu, 16 Sep 2021 08:37:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4PYaY8m1a6dHFxFOzEN/NwkC1+xn5ZJGtwTLobNFi4GxT8CLEMqO7CC5Ksu5QYLE4v+di X-Received: by 2002:a05:6402:1116:: with SMTP id u22mr7204052edv.262.1631806638908; Thu, 16 Sep 2021 08:37:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631806638; cv=none; d=google.com; s=arc-20160816; b=SYnsIpfMeGhyUzCS1F5l0AhJ+9wxJGYcudmyaKBTjRaFwhc6w3PPhCv8SyIfYMrizk MvvtiLXwB/Sx5PZxcmHPsb5+1bTRDeg63xeoVcT4Hn6KN1X13wgB1da0NEF+GfM7ZSCV lOwklkQa9Iyo0j3c0QSnCXp9i3dSUGXgPjw3J+tLLGITcIt8UX5stY/lXpCNf/YPIbYw JhTcP/fkJNbkOY6DV5YwusTejcCNx0UXFo4UZN1eWIK1xUgW8jx+XPZdQVLt6z89s/5y jXgXkmNj8OZHbQFmVecYD68xmASw4yfcU86mE59fqBR27oJ9t2T0jyYetl0b53DpQitV caIQ== 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=ly2Tyk6v2uyTRZSE1SarZgLQl+pwBqxDM1V/tylsXbA=; b=xHDtPQO2s+F75c4NK3Dm6T1WsxyTNmoGPATSWK85qtYwKpCYQdWifR1YsdRwmuehKw aNNTW0mP7q7TeD7/hqgwulQGd6nI4dDIDjGSXRUDNnS5yocVWcU/V4qRvTcSnP5zrWs8 hImh7UYFplTZlJRSWEhmTZIeAeHWhAxhV+zU6gos6czEGNOoECu32gEu2IgpSFge21MJ PxG57R89H/HZj+pzDyCYURlg65laNgNzirPFQzj8nxm+//y8coUuBKSrAfKdopWaAflr Ucl5tw/L9UtxMa3fajpSZlM+9YkPH6VaEKDDJU9FVhkrzKpVa9KjQ+IDPCIfNiqKxCOQ 6Bew== 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 g16si4129196ejm.150.2021.09.16.08.36.55; Thu, 16 Sep 2021 08:37:18 -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 S239209AbhIPPck (ORCPT + 99 others); Thu, 16 Sep 2021 11:32:40 -0400 Received: from mx24.baidu.com ([111.206.215.185]:60934 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239052AbhIPPcj (ORCPT ); Thu, 16 Sep 2021 11:32:39 -0400 Received: from BC-Mail-Ex09.internal.baidu.com (unknown [172.31.51.49]) by Forcepoint Email with ESMTPS id 1C8B01DA6463004D2149; Thu, 16 Sep 2021 23:31:17 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex09.internal.baidu.com (172.31.51.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2242.12; Thu, 16 Sep 2021 23:31:16 +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:31:16 +0800 From: Cai Huoqing To: CC: Dmitry Torokhov , , Subject: [PATCH] Input: ams_delta_serio - Make use of the helper function dev_err_probe() Date: Thu, 16 Sep 2021 23:31:11 +0800 Message-ID: <20210916153111.13780-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-Ex11.internal.baidu.com (172.31.51.51) 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/input/serio/ams_delta_serio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/serio/ams_delta_serio.c b/drivers/input/serio/ams_delta_serio.c index 1c0be299f179..9963f336e253 100644 --- a/drivers/input/serio/ams_delta_serio.c +++ b/drivers/input/serio/ams_delta_serio.c @@ -121,8 +121,8 @@ static int ams_delta_serio_init(struct platform_device *pdev) priv->vcc = devm_regulator_get(&pdev->dev, "vcc"); if (IS_ERR(priv->vcc)) { - err = PTR_ERR(priv->vcc); - dev_err(&pdev->dev, "regulator request failed (%d)\n", err); + err = dev_err_probe(&pdev->dev, PTR_ERR(priv->vcc), + "regulator request failed\n"); /* * When running on a non-dt platform and requested regulator * is not available, devm_regulator_get() never returns -- 2.25.1