From patchwork Thu Aug 27 18:58:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11741363 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CD94F1731 for ; Thu, 27 Aug 2020 18:59:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AC27722BEB for ; Thu, 27 Aug 2020 18:59:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598554794; bh=Te+1Vs7Ex+t0jDtsc8vbPvvnKgzKCI3XcxqUUGiNU9k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=qL7Nkpk5VEbr8fDgsB2GyYm9a9d462OfVHrhIA50ic06vQBZ3DoZq+LHijk31XL0i Is1FdWYqDFDve3OA0k05d3SbOA6AYJrBpdWsqw6yoIzV3cjk1wl5g0nz/OTEbL0lB9 HvofItAwVuK/bgxiWQaKvCeJfzHpFHZJpPJA6jcU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728215AbgH0S7r (ORCPT ); Thu, 27 Aug 2020 14:59:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:50256 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727031AbgH0S7q (ORCPT ); Thu, 27 Aug 2020 14:59:46 -0400 Received: from localhost.localdomain (unknown [194.230.155.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B8EA422BEA; Thu, 27 Aug 2020 18:59:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598554785; bh=Te+1Vs7Ex+t0jDtsc8vbPvvnKgzKCI3XcxqUUGiNU9k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e0SGEsni7PawLPsIP2R97uTY0qr9hyR3U3wZqfPOO62P4rFHeEGvvGzYu++3pVj4M EloGVJ1PSTUxyfSda5p8Lc45apAXiAtTTZA/lbEwS01kQalGdPN189l2q+RwN2GTPt PS4o0Ik0NkokatsH5vagMZenYvxMl+nUTx0DEMnc= From: Krzysztof Kozlowski To: Linus Walleij , Bartosz Golaszewski , Dmitry Torokhov , Hans de Goede , Bastien Nocera , Sangwon Jee , Eugen Hristev , Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, platform-driver-x86@vger.kernel.org, clang-built-linux@googlegroups.com Cc: Krzysztof Kozlowski Subject: [PATCH v3 19/27] Input: silead - Simplify with dev_err_probe() Date: Thu, 27 Aug 2020 20:58:21 +0200 Message-Id: <20200827185829.30096-20-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200827185829.30096-1-krzk@kernel.org> References: <20200827185829.30096-1-krzk@kernel.org> Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Hans de Goede Reviewed-by: Andy Shevchenko --- 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 8fa2f3b7cfd8..754debb4b2c4 100644 --- a/drivers/input/touchscreen/silead.c +++ b/drivers/input/touchscreen/silead.c @@ -512,11 +512,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)