Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1662092pxb; Thu, 16 Sep 2021 12:20:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydtBClIb9thUFMQYIbbIMhaecWIcu+S2W9FHPvYkDUm08dsv/kPRzdQ3c3Zlmp/tfj4RaE X-Received: by 2002:a05:6638:3890:: with SMTP id b16mr5829866jav.65.1631820015970; Thu, 16 Sep 2021 12:20:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631820015; cv=none; d=google.com; s=arc-20160816; b=ItNY+kzznS51riCwbkco2Fn3FMc1P58DfEA18coCl48aXcHPxzOZrrvEfPZ+egA9Iv WNKmLCyUJfRYagt03We62CayAjazl+oJuCnNs+ON+lUR+mFbb6dhFGM41yQTR9MfwkY+ InqCIzsnLkhdfDqyXDTWyBtL0YoQyndgBznsrOk5SoHowSRNj6nrkFAaazT/L9w0+uK0 ONqzb6WsEnNObr7jp9gsHL7B7/mW+K0SGAHunOhVdfVNjiFUiIjZ8iVKIFe9J4hSvnNT JfH74Q7O670k4h3vvByhcW/kWSJmN21XVe289EA5Lnqxd10dHkoBsFllbC9A/mfBe7g+ i+Eg== 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=EQx46xCT5S+ihn3HdyinBLa53oOR41UvS7CfXDDEn/0=; b=vvthoKxDEikZRSYGJqHw8oCDda/xuEX7OeNSoWZRC4dSj1VLIhlhyfzjmG0cL7IUn2 uWLaTV2N4YpL/i0PtKpYc1LiVdYOV4OBnvRDPpbndL+UcZLuwq7zh6mAsa6K5F2H77nT yPc1n/ucBl9mV1Iw0B6tFiKLxgfb5Gbh3VTWmn9dx9TslVDnG4Z6VGQ56ZED4MQV4dd1 KwG94K1nmraLeumK8la5hXTn4rbSOutWexBBs8pbgCc8SkTLgnJ2LU7WeM7WitGOfLZt jOz6nGHKA2I1tzDXzDIuJXczYaPNB4Ok4428FrEOBswsrK0W07wKtDINWngS/FSmjRZR D21A== 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 187si3528404jaf.20.2021.09.16.12.20.03; Thu, 16 Sep 2021 12:20:15 -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 S239664AbhIPPfg (ORCPT + 99 others); Thu, 16 Sep 2021 11:35:36 -0400 Received: from mx22.baidu.com ([220.181.50.185]:35076 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239110AbhIPPfb (ORCPT ); Thu, 16 Sep 2021 11:35:31 -0400 Received: from BJHW-Mail-Ex05.internal.baidu.com (unknown [10.127.64.15]) by Forcepoint Email with ESMTPS id 1862C66FE8035105EDA5; Thu, 16 Sep 2021 23:34:09 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BJHW-Mail-Ex05.internal.baidu.com (10.127.64.15) 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:34:09 +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:34:08 +0800 From: Cai Huoqing To: CC: Dmitry Torokhov , , Subject: [PATCH] Input: regulator-haptic - Make use of the helper function dev_err_probe() Date: Thu, 16 Sep 2021 23:34:02 +0800 Message-ID: <20210916153403.14999-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) X-Baidu-BdMsfe-DateCheck: 1_BJHW-Mail-Ex05_2021-09-16 23:34:09:165 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/misc/regulator-haptic.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/input/misc/regulator-haptic.c b/drivers/input/misc/regulator-haptic.c index a661e77545c5..6e6f1a390a00 100644 --- a/drivers/input/misc/regulator-haptic.c +++ b/drivers/input/misc/regulator-haptic.c @@ -169,10 +169,9 @@ static int regulator_haptic_probe(struct platform_device *pdev) } haptic->regulator = devm_regulator_get_exclusive(&pdev->dev, "haptic"); - if (IS_ERR(haptic->regulator)) { - dev_err(&pdev->dev, "failed to get regulator\n"); - return PTR_ERR(haptic->regulator); - } + if (IS_ERR(haptic->regulator)) + return dev_err_probe(&pdev->dev, PTR_ERR(haptic->regulator), + "failed to get regulator\n"); input_dev = devm_input_allocate_device(&pdev->dev); if (!input_dev) -- 2.25.1