Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1903030pxb; Mon, 20 Sep 2021 07:52:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdivXNUeKk5gTSwXIEEcclf9BQqH+0e1shEyuJlbpnFhcRGmaHe2g1f3GQ9KZ7sYZ/kR+i X-Received: by 2002:a05:6402:42d4:: with SMTP id i20mr29554772edc.348.1632149545000; Mon, 20 Sep 2021 07:52:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632149544; cv=none; d=google.com; s=arc-20160816; b=jRAEPqe9D6XbyeOjOKuHKM4GhsITs+lNzHqFU2joyw9P6CJAVQKqTLrpIxcPhW0tQV dzYyV3c5pPzn2hM6EsBWcFH2kLTAY+Y1ZAwyfamyy3Jrb2ezdA+pu/+2f39YLSguqRba xf09DeHOikCWVxScCIrrBp3td91G5yGx3raU/HNKt/ICIK4aQe/K8fuIabdJb3JZ2uzH sJI59ZWIIgaR+GkMY6iIbqP+CnWCjAjCOFpq5I6Gtsxpu6STpBPS7YjvOaw3mgcVFypa 86n1mHM9zKPkD4E1INkxo3VagDlqcNTcmaQEgpkw+AOn6uu89CW7OpJBhhQrqjYw8oxM Kxfw== 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=bLVrAsVPzmNJOF/v9flKY32xBSxFvjYHw0ZKqrQxyPk=; b=hiKhosKlYVCtmccnfjNV+/uAyhs4RY1MMA6u4Ual2fwyxrdKK5ZgXaoG2avSzugfTC yVh7AFLsfkzCY5UwU2l6mIPxJOaadCYtLWtr2/bhTTebWPKyJAQ7hkv+JPz3DZiAjZA7 9VpEXxahrhS95Vxzqu6gfuZ+mk7sc1/0oYE6TG9U+vJwBzL2gSaKMi7UGBkDOfp8TGJH sbQ0aaqT9PW5+SMFql2H7Ks80NaWp8MMre5pt3uE+P1IWvHjScIXKN8qNEACzdMeoPwP xIN5C5RyG/4QXklEhXBh63kI2ELrX2HAvgT19+VqmctlAbjezDn0OYs381lUTVShIVci K6gQ== 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 2si14957898ejh.749.2021.09.20.07.52.00; Mon, 20 Sep 2021 07:52:24 -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 S231820AbhITKfQ (ORCPT + 99 others); Mon, 20 Sep 2021 06:35:16 -0400 Received: from mx22.baidu.com ([220.181.50.185]:49726 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230510AbhITKfP (ORCPT ); Mon, 20 Sep 2021 06:35:15 -0400 Received: from BJHW-Mail-Ex01.internal.baidu.com (unknown [10.127.64.11]) by Forcepoint Email with ESMTPS id A9EEF47EE74ED1F4780D; Mon, 20 Sep 2021 18:33:42 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BJHW-Mail-Ex01.internal.baidu.com (10.127.64.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Mon, 20 Sep 2021 18:33:42 +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, 20 Sep 2021 18:33:42 +0800 From: Cai Huoqing To: CC: Linus Walleij , Dmitry Torokhov , , Subject: [PATCH v2] Input: cyttsp - Make use of the helper function dev_err_probe() Date: Mon, 20 Sep 2021 18:33:33 +0800 Message-ID: <20210920103335.243-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-Ex22.internal.baidu.com (172.31.51.16) 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/touchscreen/cyttsp_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/cyttsp_core.c b/drivers/input/touchscreen/cyttsp_core.c index 01646910c9db..661b9eb4c6a0 100644 --- a/drivers/input/touchscreen/cyttsp_core.c +++ b/drivers/input/touchscreen/cyttsp_core.c @@ -673,8 +673,7 @@ struct cyttsp *cyttsp_probe(const struct cyttsp_bus_ops *bus_ops, ts->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); if (IS_ERR(ts->reset_gpio)) { error = PTR_ERR(ts->reset_gpio); - dev_err_probe(dev, error, "Failed to request reset gpio\n"); - return ERR_PTR(error); + return ERR_PTR(dev_err_probe(dev, error, "Failed to request reset gpio\n")); } error = cyttsp_parse_properties(ts); -- 2.25.1