From patchwork Wed Aug 26 18:17:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11739337 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 3A170913 for ; Wed, 26 Aug 2020 18:19:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 15CF320737 for ; Wed, 26 Aug 2020 18:19:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465992; bh=CLfWoFp2UP/nAPTpoINiSe8V0C6mLS0vbNu1/NHgdu0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=yuafI7W6uoY5kSvQTKoIXnTMOTIzaCLNo97oIe/lE0oRDUn6gOwYGiELBeP5IzlmH NlAeCJyVx4m0shjzgC8QUAzpHChNOM9B/f1+OW4oh/061jqJtBJTvtLQMQvk+SqIZi S9GTHHMd8g2eEYQNSvhe+r800UoQRMB0NFQsW3rE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726820AbgHZSTq (ORCPT ); Wed, 26 Aug 2020 14:19:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:43038 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727895AbgHZSSs (ORCPT ); Wed, 26 Aug 2020 14:18:48 -0400 Received: from kozik-lap.mshome.net (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 57F63214F1; Wed, 26 Aug 2020 18:18:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465927; bh=CLfWoFp2UP/nAPTpoINiSe8V0C6mLS0vbNu1/NHgdu0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0PDQ8A945uJE1QgzcP+uuzJe6cY7+kwGjxOg7+vUjjvwhzCBdGObO7FgNEkoJY1Oy CzEsew420WVyGFe4gpVQckl2Byh52HJWr1g/CfgaeeUiwqFPvA8HMv3/di/xK27VLO xPkUSUeBd0EEw7LqI3MtZB+rlBYrsFfqe8Obdbr4= From: Krzysztof Kozlowski To: Dmitry Torokhov , Hans de Goede , Linus Walleij , Bastien Nocera , Sangwon Jee , Eugen Hristev , "Gustavo A. R. Silva" , Andy Shevchenko , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 21/24] Input: silead - Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 20:17:03 +0200 Message-Id: <20200826181706.11098-21-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200826181706.11098-1-krzk@kernel.org> References: <20200826181706.11098-1-krzk@kernel.org> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@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: 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)