Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1496062pxb; Thu, 16 Sep 2021 08:38:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyX7r6Qneuf6H5nx4VqR5QOYAgo9vtGFGxgXc+pVpBvb4hDO/P2uQAp/94509TQKWSCqIIi X-Received: by 2002:a05:6402:1841:: with SMTP id v1mr7302407edy.170.1631806730239; Thu, 16 Sep 2021 08:38:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631806730; cv=none; d=google.com; s=arc-20160816; b=x1RRSCeKc2htZH0G5dINqoMyy4sAhOdnlPWIcS4TYp8wfaf+jgWQo0U1iRU1Qu4uiA 0zuwifSxpGSlIpfTiEviyHKGt30UXltU4TUx1EieIrSmNl88PeU9HiFYQeKkCDjq9ofI SWuEH+zNDFf3p8m8/vO6EaJxo0DMwTgliZrDWUUrEsU0Sd2wjLoxbm29INYr77ps3MNJ +QVjp+NYGOisu+0DbjJyTohjC2viF5YxdkyE5vegeB3hV+gC6HxcqoQeQbIWyhIS6mzM 6TDl3CVjTDYrpHlJFQqGwSOdwsCf0IR34n1Rg3k2dh5m/7poMw1dpyw6XpNJSAsYaCKN 3kuw== 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=aV8RAI4np+RlHqHxtysTaryL+/XHQ46OoL7GaAJ0xtY=; b=M3EKG8TozweL5JpD7tepiLTfd03HL5RUTo3QMrNBSscKEH7zhL+Y1di2iCu/+ObHuH O6gpFyzcWlSQHdr1JVff1cFd6BAa1FVExxUrkIPBSd/ulTHB/5yV7VoAHCHwWuxZ6sl1 T6zQz2l0Kk0U3z3/XEeGr3bNccqFIONLzEACG0JfU7S8URYzjP731StDucm33P/56c6G odGJePWn0peVemLcv2hbbnHwXcQrhwqjz8ES6vl4BJmT17Km3n6i0c6QEQhg50bWd01x EPSrWp37ilRnWKWOUzUnchheX5vbmzsZJ11MsHP5w48ZOKHC1IeC5ltacWTXAfZKERyN 5bOw== 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 w12si4188386edi.177.2021.09.16.08.38.25; Thu, 16 Sep 2021 08:38:50 -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 S239448AbhIPPgA (ORCPT + 99 others); Thu, 16 Sep 2021 11:36:00 -0400 Received: from mx22.baidu.com ([220.181.50.185]:35338 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239897AbhIPPf4 (ORCPT ); Thu, 16 Sep 2021 11:35:56 -0400 Received: from BJHW-Mail-Ex08.internal.baidu.com (unknown [10.127.64.18]) by Forcepoint Email with ESMTPS id 95D58E59724AAD5CD9AB; Thu, 16 Sep 2021 23:34:31 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BJHW-Mail-Ex08.internal.baidu.com (10.127.64.18) 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:31 +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:30 +0800 From: Cai Huoqing To: CC: Hans de Goede , Dmitry Torokhov , , , Subject: [PATCH] Input: silead - Make use of the helper function dev_err_probe() Date: Thu, 16 Sep 2021 23:34:25 +0800 Message-ID: <20210916153426.15158-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-Ex08_2021-09-16 23:34:31:702 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/silead.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/input/touchscreen/silead.c b/drivers/input/touchscreen/silead.c index 1ee760bac0cf..adfac271f0b5 100644 --- a/drivers/input/touchscreen/silead.c +++ b/drivers/input/touchscreen/silead.c @@ -548,11 +548,9 @@ static int silead_ts_probe(struct i2c_client *client, /* Power GPIO pin */ data->gpio_power = devm_gpiod_get_optional(dev, "power", GPIOD_OUT_LOW); - if (IS_ERR(data->gpio_power)) { - if (PTR_ERR(data->gpio_power) != -EPROBE_DEFER) - dev_err(dev, "Shutdown GPIO request failed\n"); - return PTR_ERR(data->gpio_power); - } + if (IS_ERR(data->gpio_power)) + return dev_err_probe(dev, PTR_ERR(data->gpio_power), + "Shutdown GPIO request failed\n"); error = silead_ts_setup(client); if (error) -- 2.25.1