From patchwork Wed Aug 26 18:16:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 255067 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A4A7C433E1 for ; Wed, 26 Aug 2020 18:17:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5209720737 for ; Wed, 26 Aug 2020 18:17:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465847; bh=S63b8jH3yXPTdFcjM0wgK1kGIdL/qW7ae7J48kYeDyA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=P18uogbAF7mYzU71yaZ3blN/sgaKhiPpUmAtfwDiMptJH56qeXAUGDyTjhDEdoyGN Z3lrRqmn5H/282FNfeGhhhueLCBjVit8s34WfJW2DUDDnqZVZlZm+WY3kYb3jNOox/ ErP/2JpskMBsa7eVDkvxbiEKV/sMxRfYc5gZze8Y= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726845AbgHZSRY (ORCPT ); Wed, 26 Aug 2020 14:17:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:39590 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726818AbgHZSRV (ORCPT ); Wed, 26 Aug 2020 14:17:21 -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 892E020786; Wed, 26 Aug 2020 18:17:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465840; bh=S63b8jH3yXPTdFcjM0wgK1kGIdL/qW7ae7J48kYeDyA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TIjMx1lppHHDR7v9UebK4nY3MBUuPIMmGHoBMm5ceEhguzm3KolsI1hBRP2xWwTb0 LVn0YIhj2IZBnVUq7CwOJxQ+oNMy+pnArbP2XDTVKWKxNsriOktu8k/AC544MgHmef vEMcloJdXskKDGsWwlVwbdRm1v11SWVxrUihLk7g= 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 02/24] Input: gpio_keys - Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 20:16:44 +0200 Message-Id: <20200826181706.11098-2-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 --- drivers/input/keyboard/gpio_keys.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index f2d4e4daa818..6f670cbe8a8b 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -505,10 +505,7 @@ static int gpio_keys_setup_key(struct platform_device *pdev, */ bdata->gpiod = NULL; } else { - if (error != -EPROBE_DEFER) - dev_err(dev, "failed to get gpio: %d\n", - error); - return error; + return dev_err_probe(dev, error, "failed to get gpio\n"); } } } else if (gpio_is_valid(button->gpio)) { From patchwork Wed Aug 26 18:16:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 255066 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94112C433E1 for ; Wed, 26 Aug 2020 18:17:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 60C4E207BC for ; Wed, 26 Aug 2020 18:17:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465879; bh=bFWXrahWZE4RHtfb+fZwx6Jtt7jkIi/qT02KwyGXOCU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=BIavQkNY7EuOwzZlSEsbWgv2TIjLAPPBJMa49vIySaKrwZfTtDUNr5yNnV8s+ybnb SPTdpk2mr4ikZ40d/CSx5qL3//9uPVOtj2OZbxhBfBKOUOR1sw4JBA6nJ5Ow00gUTW 7Vnv/TfdKvhibZbrf9GvevveJiCDlgrF8Ouvbm4A= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726802AbgHZSRt (ORCPT ); Wed, 26 Aug 2020 14:17:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:40514 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726834AbgHZSRr (ORCPT ); Wed, 26 Aug 2020 14:17:47 -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 D1D672083B; Wed, 26 Aug 2020 18:17:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465867; bh=bFWXrahWZE4RHtfb+fZwx6Jtt7jkIi/qT02KwyGXOCU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ddqnq4zB7lPpM7hzVw1IloUX1PupoBZcOzkPV3jMtjXridhGL/WBng3zm33pTk6v/ dgkG5XGalcVMSSbYyjt9mElmrSSi60XlrBZuAwkMkzwiGxWGT/VVygfdN1TUZQ/pT9 ZnlQ86TvdUWo0Xzii6iUDBEOIkSqSezzlrjUTfUY= 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 06/24] Input: pwm-vibra - Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 20:16:48 +0200 Message-Id: <20200826181706.11098-6-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 --- drivers/input/misc/pwm-vibra.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/input/misc/pwm-vibra.c b/drivers/input/misc/pwm-vibra.c index 81e777a04b88..e45cd6801208 100644 --- a/drivers/input/misc/pwm-vibra.c +++ b/drivers/input/misc/pwm-vibra.c @@ -135,21 +135,13 @@ static int pwm_vibrator_probe(struct platform_device *pdev) vibrator->vcc = devm_regulator_get(&pdev->dev, "vcc"); err = PTR_ERR_OR_ZERO(vibrator->vcc); - if (err) { - if (err != -EPROBE_DEFER) - dev_err(&pdev->dev, "Failed to request regulator: %d", - err); - return err; - } + if (err) + return dev_err_probe(&pdev->dev, err, "Failed to request regulator\n"); vibrator->pwm = devm_pwm_get(&pdev->dev, "enable"); err = PTR_ERR_OR_ZERO(vibrator->pwm); - if (err) { - if (err != -EPROBE_DEFER) - dev_err(&pdev->dev, "Failed to request main pwm: %d", - err); - return err; - } + if (err) + return dev_err_probe(&pdev->dev, err, "Failed to request main pwm\n"); INIT_WORK(&vibrator->play_work, pwm_vibrator_play_work); From patchwork Wed Aug 26 18:16:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 255056 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D81D3C433E3 for ; Wed, 26 Aug 2020 18:20:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B2F0E20737 for ; Wed, 26 Aug 2020 18:20:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598466006; bh=MhmkwJ2yyDo7W16oC/eUQhQtQQPiKt2NFHFuo0anrwg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=mHozBONAJdpzOOdhszty8pqYTLI2kcWPmXjGJcQoaAoxBlthpXWZFwkMr3x7nH0A7 cZUYBL/EOzLe4FUMLmP4V1Oe5qKPU0G2UUQ8fBFoJTuUP9uOOnRGDa9OLYIECcGcW9 lpkQwSkevl1hp4MBAU59/RNS+3GxSxkEBrU+DDcU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726838AbgHZSUG (ORCPT ); Wed, 26 Aug 2020 14:20:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:40774 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727047AbgHZSRx (ORCPT ); Wed, 26 Aug 2020 14:17:53 -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 8D8A320786; Wed, 26 Aug 2020 18:17:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465872; bh=MhmkwJ2yyDo7W16oC/eUQhQtQQPiKt2NFHFuo0anrwg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fBU6CEuAA0amVc+6o5CPkB5Rh3XmQO1TEJXL+cFkD0c5P+wobSWcKG4cGtSSrqiZj 68w16vrtYopb/o6hDHNTwOaolZi3w6lxHP1apv/XOs1PYC+eh5xT5eejdertKgYtQt PD6sAFEl2vaV85bkDGWgwMlt7HPTV36kavA/5rgc= 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 07/24] Input: rotary_encoder - Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 20:16:49 +0200 Message-Id: <20200826181706.11098-7-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 --- drivers/input/misc/rotary_encoder.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/input/misc/rotary_encoder.c b/drivers/input/misc/rotary_encoder.c index 6d613f2a017c..ea56c9f4975a 100644 --- a/drivers/input/misc/rotary_encoder.c +++ b/drivers/input/misc/rotary_encoder.c @@ -236,12 +236,8 @@ static int rotary_encoder_probe(struct platform_device *pdev) device_property_read_bool(dev, "rotary-encoder,relative-axis"); encoder->gpios = devm_gpiod_get_array(dev, NULL, GPIOD_IN); - if (IS_ERR(encoder->gpios)) { - err = PTR_ERR(encoder->gpios); - if (err != -EPROBE_DEFER) - dev_err(dev, "unable to get gpios: %d\n", err); - return err; - } + if (IS_ERR(encoder->gpios)) + return dev_err_probe(dev, PTR_ERR(encoder->gpios), "unable to get gpios\n"); if (encoder->gpios->ndescs < 2) { dev_err(dev, "not enough gpios found\n"); return -EINVAL; From patchwork Wed Aug 26 18:16:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 255057 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 827A4C433DF for ; Wed, 26 Aug 2020 18:20:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5497F207BC for ; Wed, 26 Aug 2020 18:20:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598466006; bh=DPQF77aMjkh7Faa6F4bZ0KOUmZpaZ+wObfMV6Kit2jo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=GtJSYUvKROK45Y/xU6y7Y1EM4cT0MYE1vmXqvBmQSdj2gerpHCyXpncn8IvbGxi78 gDw4v8ArGSDCoU91I7LbW2S6534iDJ9A3OCyg/fC0LGxXFJgpH/trbU55RpcKIHsoN v+4M4ZDUUicOjBRHUcK5+INhPqjg935KEVylBej0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727061AbgHZSSC (ORCPT ); Wed, 26 Aug 2020 14:18:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:40936 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726442AbgHZSR5 (ORCPT ); Wed, 26 Aug 2020 14:17:57 -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 2DD1B2083B; Wed, 26 Aug 2020 18:17:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465876; bh=DPQF77aMjkh7Faa6F4bZ0KOUmZpaZ+wObfMV6Kit2jo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PbBpUBLm5MDXI2Ck3SvUjsj1zYVbR0BAcdelKMYhlfODxf3q+tLb5Lp6ORHN95uST XoajrjKgJuamZ601iFTHooRBYfL7QFtDoyYRl41TVhWmst6/hN8VLpzIUu31pCu6OE lubuHAw0LDBp6o/cIj+gn/wkmptlkKGWqDFyN/VQ= 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 08/24] Input: elan_i2c - Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 20:16:50 +0200 Message-Id: <20200826181706.11098-8-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 --- drivers/input/mouse/elan_i2c_core.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c index c599e21a8478..d703b0d5a3bd 100644 --- a/drivers/input/mouse/elan_i2c_core.c +++ b/drivers/input/mouse/elan_i2c_core.c @@ -1229,13 +1229,8 @@ static int elan_probe(struct i2c_client *client, mutex_init(&data->sysfs_mutex); data->vcc = devm_regulator_get(dev, "vcc"); - if (IS_ERR(data->vcc)) { - error = PTR_ERR(data->vcc); - if (error != -EPROBE_DEFER) - dev_err(dev, "Failed to get 'vcc' regulator: %d\n", - error); - return error; - } + if (IS_ERR(data->vcc)) + return dev_err_probe(dev, PTR_ERR(data->vcc), "Failed to get 'vcc' regulator\n"); error = regulator_enable(data->vcc); if (error) { From patchwork Wed Aug 26 18:16:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 255065 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA8C9C433DF for ; Wed, 26 Aug 2020 18:18:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BE1E6208E4 for ; Wed, 26 Aug 2020 18:18:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465891; bh=/d4BjFY2ap9+l6rWTJFZn1Ski4MoGXTAYNl4MMOq0gs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=RzNJ7nOSlCJJT3x4BdLv1LjcC35mBp12BciDk1CT83L1J+cSYK23HXYAwlReyb9By EiJSztoR+PgT0jjck5CsLJaXJWIJHShjOsa1jRKfsBR4arqCNwVrOfpvEyaThE3vOS nfGFZtigO9uVIcLqhWElijP6r/w1dUNH/upwzMOI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726834AbgHZSSC (ORCPT ); Wed, 26 Aug 2020 14:18:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:41062 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727049AbgHZSSA (ORCPT ); Wed, 26 Aug 2020 14:18:00 -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 4167C22B47; Wed, 26 Aug 2020 18:17:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465880; bh=/d4BjFY2ap9+l6rWTJFZn1Ski4MoGXTAYNl4MMOq0gs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qSWpCUOKvobJmpH0O/23WwT/S7TFqh3Db4hqmp1qTMMEi0xx+gdN5JeZrmSmWzGpZ aCAkk9KVnvnpvYzArP7MOiyrKnuQ+XBfABs47/UtyPAeJrSQyUrpaXdR6hWqkiUH6c +9YPeScx7dfXKaYermxU71Js8+4n6If50x7WbQQM= 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 09/24] Input: bu21013_ts - Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 20:16:51 +0200 Message-Id: <20200826181706.11098-9-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 --- drivers/input/touchscreen/bu21013_ts.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/input/touchscreen/bu21013_ts.c b/drivers/input/touchscreen/bu21013_ts.c index 2f1f0d7607f8..bb99405b5dac 100644 --- a/drivers/input/touchscreen/bu21013_ts.c +++ b/drivers/input/touchscreen/bu21013_ts.c @@ -497,11 +497,9 @@ static int bu21013_probe(struct i2c_client *client, /* Named "CS" on the chip, DT binding is "reset" */ ts->cs_gpiod = devm_gpiod_get(&client->dev, "reset", GPIOD_OUT_HIGH); error = PTR_ERR_OR_ZERO(ts->cs_gpiod); - if (error) { - if (error != -EPROBE_DEFER) - dev_err(&client->dev, "failed to get CS GPIO\n"); - return error; - } + if (error) + return dev_err_probe(&client->dev, error, "failed to get CS GPIO\n"); + gpiod_set_consumer_name(ts->cs_gpiod, "BU21013 CS"); error = devm_add_action_or_reset(&client->dev, @@ -516,11 +514,8 @@ static int bu21013_probe(struct i2c_client *client, ts->int_gpiod = devm_gpiod_get_optional(&client->dev, "touch", GPIOD_IN); error = PTR_ERR_OR_ZERO(ts->int_gpiod); - if (error) { - if (error != -EPROBE_DEFER) - dev_err(&client->dev, "failed to get INT GPIO\n"); - return error; - } + if (error) + return dev_err_probe(&client->dev, error, "failed to get INT GPIO\n"); if (ts->int_gpiod) gpiod_set_consumer_name(ts->int_gpiod, "BU21013 INT"); From patchwork Wed Aug 26 18:16:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 255064 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5AEDC433E1 for ; Wed, 26 Aug 2020 18:18:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8679F207BC for ; Wed, 26 Aug 2020 18:18:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465899; bh=BJVFQy3/ZY4QN0q1KpODN4O1wsNuQRFbfec6DZhQ+d0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=vshHlza0juJM5D1Iu2U0obTHZ7Zqxb2ZzdG6h8lO6m2whmVlVYSD09pZ6NgiCSxlM O5nL/LNTs4Q9xLsg7+ZsCLXzTVUTUqlcZdB6FSHsicMjrlV9jMUC5iIjfYTUthaZJI GTElViiQWh4kfhTTy47qE5QfuyJGVLXX5w5nhM4E= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727783AbgHZSSR (ORCPT ); Wed, 26 Aug 2020 14:18:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:41528 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727111AbgHZSSM (ORCPT ); Wed, 26 Aug 2020 14:18:12 -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 8AA1222B40; Wed, 26 Aug 2020 18:18:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465891; bh=BJVFQy3/ZY4QN0q1KpODN4O1wsNuQRFbfec6DZhQ+d0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F3VqhC8R0Eqi0HEnUJg6V5+uRGmJEB4ioxGk3UB+VWXhEFUtBD+aT3/gCycWyCQ16 RmifWmG4gBMPpOpmF9AXHvvhJvV6eA3wKwLYBD0Av5WCFZMWTjhz8IQSh3xgJKWkKY FzVqWIveihljNC4og5ce315GsEQUiOB+t364LNEQ= 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 11/24] Input: chipone_icn8318 - Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 20:16:53 +0200 Message-Id: <20200826181706.11098-11-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 --- drivers/input/touchscreen/chipone_icn8318.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/input/touchscreen/chipone_icn8318.c b/drivers/input/touchscreen/chipone_icn8318.c index d91d2fd78649..5bee007184c4 100644 --- a/drivers/input/touchscreen/chipone_icn8318.c +++ b/drivers/input/touchscreen/chipone_icn8318.c @@ -194,12 +194,8 @@ static int icn8318_probe(struct i2c_client *client, return -ENOMEM; data->wake_gpio = devm_gpiod_get(dev, "wake", GPIOD_OUT_LOW); - if (IS_ERR(data->wake_gpio)) { - error = PTR_ERR(data->wake_gpio); - if (error != -EPROBE_DEFER) - dev_err(dev, "Error getting wake gpio: %d\n", error); - return error; - } + if (IS_ERR(data->wake_gpio)) + return dev_err_probe(dev, PTR_ERR(data->wake_gpio), "Error getting wake gpio\n"); input = devm_input_allocate_device(dev); if (!input) From patchwork Wed Aug 26 18:16:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 255063 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE6DEC433DF for ; Wed, 26 Aug 2020 18:18:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9E30C20737 for ; Wed, 26 Aug 2020 18:18:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465914; bh=QRZ2bQQtheOypVoyAK/PzaZmjf1dQjEQJxQMbx49de0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=bbQS75jDSPCGkXZcIIIApH20GYgvCLmljnzN5Aj8XnIC+CrW2C+t0SbonSS/mpV4D 5nq7RbJ7QuxQY9tj57h8QOor1BR43k5Wv0TCd54r0AKUIRg3t9SZeMgLrNoCMkSPW5 ZNILzFlZ/8f/XJ/w2f3cnvN7f+A87Y8iadyvX95Q= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727813AbgHZSS1 (ORCPT ); Wed, 26 Aug 2020 14:18:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:42058 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726858AbgHZSSZ (ORCPT ); Wed, 26 Aug 2020 14:18:25 -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 9C2BC20737; Wed, 26 Aug 2020 18:18:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465904; bh=QRZ2bQQtheOypVoyAK/PzaZmjf1dQjEQJxQMbx49de0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iSQPH1+qnOXJ0r+evYR/XNlyyX6uhSA9ICStJXZYAQXDQdweY/fk9JiHJtdf32PKk dl6TmIZkqdXjlP1a0leJusa0M8zSHwRJm3ZVEpP9Q9cN6NswKF+ESkhUBAfaOJr0e9 VF+95zhHhI3Z83hPqJoxaukZUuzuO7pCvcuCSmoE= 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 14/24] Input: ektf2127 - Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 20:16:56 +0200 Message-Id: <20200826181706.11098-14-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 --- drivers/input/touchscreen/ektf2127.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/input/touchscreen/ektf2127.c b/drivers/input/touchscreen/ektf2127.c index eadd389cf81f..cd41483cfae5 100644 --- a/drivers/input/touchscreen/ektf2127.c +++ b/drivers/input/touchscreen/ektf2127.c @@ -237,12 +237,8 @@ static int ektf2127_probe(struct i2c_client *client, /* This requests the gpio *and* turns on the touchscreen controller */ ts->power_gpios = devm_gpiod_get(dev, "power", GPIOD_OUT_HIGH); - if (IS_ERR(ts->power_gpios)) { - error = PTR_ERR(ts->power_gpios); - if (error != -EPROBE_DEFER) - dev_err(dev, "Error getting power gpio: %d\n", error); - return error; - } + if (IS_ERR(ts->power_gpios)) + return dev_err_probe(dev, PTR_ERR(ts->power_gpios), "Error getting power gpio\n"); input = devm_input_allocate_device(dev); if (!input) From patchwork Wed Aug 26 18:16:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 255062 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DAA4C433E3 for ; Wed, 26 Aug 2020 18:18:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6B46522B49 for ; Wed, 26 Aug 2020 18:18:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465917; bh=wc+b82bTQHczHUSk3dpD7WERqiGfyqDJdv7UpdSi9RM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=PJol9yKfOCcFyUPmQmHtPxaeEqiuJvVUJ73Lk0ZXS5F8at53w9zspF8JWa+H1N4Sg 4Y6gBqZ+UaZUd4PZPVI+6LUbEAdRdeTdJc+2j6dpiYpuqG6V/9dAjmfxTnaMZ35zmc 28mr4MyYxrX5K1Ep2mMRmYHhuP6mQaouY1QDFY2A= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727834AbgHZSSg (ORCPT ); Wed, 26 Aug 2020 14:18:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:42356 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727817AbgHZSSc (ORCPT ); Wed, 26 Aug 2020 14:18:32 -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 8D961208E4; Wed, 26 Aug 2020 18:18:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465911; bh=wc+b82bTQHczHUSk3dpD7WERqiGfyqDJdv7UpdSi9RM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wTIn6Baf6gF7WS/c37UJaugfgZk7yAvxZba56OhEt0JtNfy9QX/5n9gzEJsENo2FT SBxzgCkNOWq4IXJqAlC3N+mYZsG3Fo6i4znpkkwlDfjE917kfkL3UjxrVwhkPKQUjH 4JuSvg5VFUlNOXCjmH94GbwXAgkhL5Z9dnV8jrdU= 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 16/24] Input: goodix - Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 20:16:58 +0200 Message-Id: <20200826181706.11098-16-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 --- drivers/input/touchscreen/goodix.c | 40 ++++++++---------------------- 1 file changed, 11 insertions(+), 29 deletions(-) diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c index 02c75ea385e0..48c4c3d297fe 100644 --- a/drivers/input/touchscreen/goodix.c +++ b/drivers/input/touchscreen/goodix.c @@ -864,7 +864,6 @@ static int goodix_add_acpi_gpio_mappings(struct goodix_ts_data *ts) */ static int goodix_get_gpio_config(struct goodix_ts_data *ts) { - int error; struct device *dev; struct gpio_desc *gpiod; bool added_acpi_mappings = false; @@ -874,33 +873,20 @@ static int goodix_get_gpio_config(struct goodix_ts_data *ts) dev = &ts->client->dev; ts->avdd28 = devm_regulator_get(dev, "AVDD28"); - if (IS_ERR(ts->avdd28)) { - error = PTR_ERR(ts->avdd28); - if (error != -EPROBE_DEFER) - dev_err(dev, - "Failed to get AVDD28 regulator: %d\n", error); - return error; - } + if (IS_ERR(ts->avdd28)) + return dev_err_probe(dev, PTR_ERR(ts->avdd28), "Failed to get AVDD28 regulator\n"); ts->vddio = devm_regulator_get(dev, "VDDIO"); - if (IS_ERR(ts->vddio)) { - error = PTR_ERR(ts->vddio); - if (error != -EPROBE_DEFER) - dev_err(dev, - "Failed to get VDDIO regulator: %d\n", error); - return error; - } + if (IS_ERR(ts->vddio)) + return dev_err_probe(dev, PTR_ERR(ts->vddio), "Failed to get VDDIO regulator\n"); retry_get_irq_gpio: /* Get the interrupt GPIO pin number */ gpiod = devm_gpiod_get_optional(dev, GOODIX_GPIO_INT_NAME, GPIOD_IN); - if (IS_ERR(gpiod)) { - error = PTR_ERR(gpiod); - if (error != -EPROBE_DEFER) - dev_dbg(dev, "Failed to get %s GPIO: %d\n", - GOODIX_GPIO_INT_NAME, error); - return error; - } + if (IS_ERR(gpiod)) + return dev_err_probe(dev, PTR_ERR(gpiod), "Failed to get %s GPIO\n", + GOODIX_GPIO_INT_NAME); + if (!gpiod && has_acpi_companion(dev) && !added_acpi_mappings) { added_acpi_mappings = true; if (goodix_add_acpi_gpio_mappings(ts) == 0) @@ -911,13 +897,9 @@ static int goodix_get_gpio_config(struct goodix_ts_data *ts) /* Get the reset line GPIO pin number */ gpiod = devm_gpiod_get_optional(dev, GOODIX_GPIO_RST_NAME, GPIOD_IN); - if (IS_ERR(gpiod)) { - error = PTR_ERR(gpiod); - if (error != -EPROBE_DEFER) - dev_dbg(dev, "Failed to get %s GPIO: %d\n", - GOODIX_GPIO_RST_NAME, error); - return error; - } + if (IS_ERR(gpiod)) + return dev_err_probe(dev, PTR_ERR(gpiod), "Failed to get %s GPIO\n", + GOODIX_GPIO_RST_NAME); ts->gpiod_rst = gpiod; From patchwork Wed Aug 26 18:17:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 255058 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 591E8C433E1 for ; Wed, 26 Aug 2020 18:19:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3474C20737 for ; Wed, 26 Aug 2020 18:19:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465996; bh=T6TFZj9w5aHZrZ0f+bpIypxGUI4p0QxsrYCpZFKfb40=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=mCD5pg6CxTRx0mGaJRjK1SBiUvb/Ws2+Y0EHmAyJ/HChNF3jYK8PAo/DVkW3JnLa8 6ngaOI0MoBS72cNR/+l1NGeIxbBaSStFMcq5J60FEpWzXx09VQSYmnwrEtByRxE6gz ym6yzxKQESJnnwHf98/JQGscyxs5pccNt4ZJ+uGo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728019AbgHZSTw (ORCPT ); Wed, 26 Aug 2020 14:19:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:42706 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727851AbgHZSSj (ORCPT ); Wed, 26 Aug 2020 14:18:39 -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 667C6214F1; Wed, 26 Aug 2020 18:18:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465918; bh=T6TFZj9w5aHZrZ0f+bpIypxGUI4p0QxsrYCpZFKfb40=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S2sOiki0erxXIKebMT9vaLIM1HaCpXOZodBCFrPik4ObNJ5Ihc4DrlCSJjoyVuosm r+5TsVXSi+c5G8vebrYpklPjH5CDbF4tibmDzE8Yh6VW2ddg/hCKV6Nkh4BmqTS4KC gHOEFnUmeG8/vI1Bixqs8ALZTojw9r4IXyT5/OaE= 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 18/24] Input: pixcir_i2c_ts - Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 20:17:00 +0200 Message-Id: <20200826181706.11098-18-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 --- drivers/input/touchscreen/pixcir_i2c_ts.c | 38 +++++++---------------- 1 file changed, 12 insertions(+), 26 deletions(-) diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c b/drivers/input/touchscreen/pixcir_i2c_ts.c index 9aa098577350..fb37567e2d7e 100644 --- a/drivers/input/touchscreen/pixcir_i2c_ts.c +++ b/drivers/input/touchscreen/pixcir_i2c_ts.c @@ -515,41 +515,27 @@ static int pixcir_i2c_ts_probe(struct i2c_client *client, input_set_drvdata(input, tsdata); tsdata->gpio_attb = devm_gpiod_get(dev, "attb", GPIOD_IN); - if (IS_ERR(tsdata->gpio_attb)) { - error = PTR_ERR(tsdata->gpio_attb); - if (error != -EPROBE_DEFER) - dev_err(dev, "Failed to request ATTB gpio: %d\n", - error); - return error; - } + if (IS_ERR(tsdata->gpio_attb)) + return dev_err_probe(dev, PTR_ERR(tsdata->gpio_attb), + "Failed to request ATTB gpio\n"); tsdata->gpio_reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); - if (IS_ERR(tsdata->gpio_reset)) { - error = PTR_ERR(tsdata->gpio_reset); - if (error != -EPROBE_DEFER) - dev_err(dev, "Failed to request RESET gpio: %d\n", - error); - return error; - } + if (IS_ERR(tsdata->gpio_reset)) + return dev_err_probe(dev, PTR_ERR(tsdata->gpio_reset), + "Failed to request RESET gpio\n"); tsdata->gpio_wake = devm_gpiod_get_optional(dev, "wake", GPIOD_OUT_HIGH); - if (IS_ERR(tsdata->gpio_wake)) { - error = PTR_ERR(tsdata->gpio_wake); - if (error != -EPROBE_DEFER) - dev_err(dev, "Failed to get wake gpio: %d\n", error); - return error; - } + if (IS_ERR(tsdata->gpio_wake)) + return dev_err_probe(dev, PTR_ERR(tsdata->gpio_wake), + "Failed to get wake gpio\n"); tsdata->gpio_enable = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_HIGH); - if (IS_ERR(tsdata->gpio_enable)) { - error = PTR_ERR(tsdata->gpio_enable); - if (error != -EPROBE_DEFER) - dev_err(dev, "Failed to get enable gpio: %d\n", error); - return error; - } + if (IS_ERR(tsdata->gpio_enable)) + return dev_err_probe(dev, PTR_ERR(tsdata->gpio_enable), + "Failed to get enable gpio\n"); if (tsdata->gpio_enable) msleep(100); From patchwork Wed Aug 26 18:17:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 255059 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A00CC433E1 for ; Wed, 26 Aug 2020 18:19:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 67D6120786 for ; Wed, 26 Aug 2020 18:19:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465986; bh=0n3TKILnSeWeNht9U3KmADSMA4OlGLCD53W9Sw4h45w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=xbv7lyLZxwceTjBjZUX6Zn3AYWzD4aztNCIOvXpbnKgO4BkhxshmiZroEvS7d65Ng mtMApWr0prBCgss+eqlyuK2PPFTkJu/LyLzLdMMHWeYAMivA5asgxPSPBjk6T4VpFa 2YjPjj7tejctASr+LNCfxlzCN/dDQ8gP/ZU9LbZw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727875AbgHZSSn (ORCPT ); Wed, 26 Aug 2020 14:18:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:42808 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727863AbgHZSSm (ORCPT ); Wed, 26 Aug 2020 14:18:42 -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 1D3D02083B; Wed, 26 Aug 2020 18:18:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465921; bh=0n3TKILnSeWeNht9U3KmADSMA4OlGLCD53W9Sw4h45w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EcsOzYDJUI4mXTjgNjWb2iyY8AqXk4a1CAcaOY9Ou7SHlrTdCY7dMpwi3BgQEgqtW P4z1Wlf7rgYnF2dwq/GGVSLWjB40Is5jRgoB225/XXcDz7zeyTsBFAGuuVJuTk9hiD uSFkXjJzADQX3QymjmvX1fIxZHVyhCyLssES+STQ= 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 19/24] Input: raydium_i2c_ts - Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 20:17:01 +0200 Message-Id: <20200826181706.11098-19-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 --- drivers/input/touchscreen/raydium_i2c_ts.c | 30 +++++++--------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/drivers/input/touchscreen/raydium_i2c_ts.c b/drivers/input/touchscreen/raydium_i2c_ts.c index fe245439adee..4017775f6466 100644 --- a/drivers/input/touchscreen/raydium_i2c_ts.c +++ b/drivers/input/touchscreen/raydium_i2c_ts.c @@ -1015,32 +1015,20 @@ static int raydium_i2c_probe(struct i2c_client *client, i2c_set_clientdata(client, ts); ts->avdd = devm_regulator_get(&client->dev, "avdd"); - if (IS_ERR(ts->avdd)) { - error = PTR_ERR(ts->avdd); - if (error != -EPROBE_DEFER) - dev_err(&client->dev, - "Failed to get 'avdd' regulator: %d\n", error); - return error; - } + if (IS_ERR(ts->avdd)) + return dev_err_probe(&client->dev, PTR_ERR(ts->avdd), + "Failed to get 'avdd' regulator\n"); ts->vccio = devm_regulator_get(&client->dev, "vccio"); - if (IS_ERR(ts->vccio)) { - error = PTR_ERR(ts->vccio); - if (error != -EPROBE_DEFER) - dev_err(&client->dev, - "Failed to get 'vccio' regulator: %d\n", error); - return error; - } + if (IS_ERR(ts->vccio)) + return dev_err_probe(&client->dev, PTR_ERR(ts->vccio), + "Failed to get 'vccio' regulator\n"); ts->reset_gpio = devm_gpiod_get_optional(&client->dev, "reset", GPIOD_OUT_LOW); - if (IS_ERR(ts->reset_gpio)) { - error = PTR_ERR(ts->reset_gpio); - if (error != -EPROBE_DEFER) - dev_err(&client->dev, - "failed to get reset gpio: %d\n", error); - return error; - } + if (IS_ERR(ts->reset_gpio)) + return dev_err_probe(&client->dev, PTR_ERR(ts->reset_gpio), + "Failed to get reset gpio\n"); error = raydium_i2c_power_on(ts); if (error) From patchwork Wed Aug 26 18:17:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 255061 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50847C433DF for ; Wed, 26 Aug 2020 18:18:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1DBBF20737 for ; Wed, 26 Aug 2020 18:18:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465930; bh=DAJ4IK0T3bYzcNbVBNiI+Vu9Q4UxL1+YwJDRQtT/cUQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=CNIMMjobEgttgxmLJapex2krlX2hcmX8aZNLxlNDBy1rIGEtyS94aDSy/VRjqW3hr qhYJXD0UvYkPk/wtCa1TfQkrP8JZSq0Wmtk9ortA7EcmeiZ2/+uDOU0c87Gawv8P1B tKIef5r/DLGnCnm0WlujN3NRf9Ukkrb/ykM+3/Wg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726858AbgHZSSt (ORCPT ); Wed, 26 Aug 2020 14:18:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:42916 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727881AbgHZSSp (ORCPT ); Wed, 26 Aug 2020 14:18:45 -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 2237320737; Wed, 26 Aug 2020 18:18:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465924; bh=DAJ4IK0T3bYzcNbVBNiI+Vu9Q4UxL1+YwJDRQtT/cUQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xi7x5aqOUP5FpsDQ38MnGbVt+nIQx7FmM4kLD0OEKTs+oY0REYpQ1krT3q5OgonML 4YTzELWJpn5wldO2Q93XCvCJjGFWkqPymXeVXuyeSpK/TmATtoGHfpLuScbizBmGyh a84AEQBcmfVgZ6LkVKAXN8WNRLhUYIC6X6TzrdTo= 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 20/24] Input: resistive-adc-touch - Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 20:17:02 +0200 Message-Id: <20200826181706.11098-20-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 --- drivers/input/touchscreen/resistive-adc-touch.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/input/touchscreen/resistive-adc-touch.c b/drivers/input/touchscreen/resistive-adc-touch.c index cfc8bb4553f7..46b5a6caef84 100644 --- a/drivers/input/touchscreen/resistive-adc-touch.c +++ b/drivers/input/touchscreen/resistive-adc-touch.c @@ -108,12 +108,8 @@ static int grts_probe(struct platform_device *pdev) /* get the channels from IIO device */ st->iio_chans = devm_iio_channel_get_all(dev); - if (IS_ERR(st->iio_chans)) { - error = PTR_ERR(st->iio_chans); - if (error != -EPROBE_DEFER) - dev_err(dev, "can't get iio channels.\n"); - return error; - } + if (IS_ERR(st->iio_chans)) + return dev_err_probe(dev, PTR_ERR(st->iio_chans), "can't get iio channels\n"); chan = &st->iio_chans[0]; st->pressure = false; From patchwork Wed Aug 26 18:17:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 255060 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C64B4C433DF for ; Wed, 26 Aug 2020 18:19:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A395B214F1 for ; Wed, 26 Aug 2020 18:19:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465978; bh=UtLy7AgPaFb//7CHgB1vkCVLxxP0PzgmjazwcTLjaos=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=LFRTCLh3qYme9gT6b4l6RevLlrcbWDFpOova+mduJISgivqBMV7Cbc0OxGfMkV+aS nJX3aMPQqwFt1RTlGu/xZTBR5mpvBtoV+GCfbNb1hl62U/VM7Ua7iQZY+kA3ODYA8y B42vdwvv8s2vnqEzbZ8j6kvP9+c7QXCJqOnGvykw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727931AbgHZSS5 (ORCPT ); Wed, 26 Aug 2020 14:18:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:43220 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727912AbgHZSSv (ORCPT ); Wed, 26 Aug 2020 14:18:51 -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 6B779208E4; Wed, 26 Aug 2020 18:18:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465930; bh=UtLy7AgPaFb//7CHgB1vkCVLxxP0PzgmjazwcTLjaos=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AqY4f3f4lrGjeD5KfEVTdteWCTy/0gr+i38zARP6gRc+JWPHtJbB/RdX6NRmNurdh SY8tze/unZTbbyjZHr6cdNDJT05Je9fhV0Es+gmssnNsVFYY8Uy9rscuAIbiuFpUvV uRYjdLOpaFHXmfeB0KSBY190NzbB3FGo81z2wMNI= 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 22/24] Input: sis_i2c - Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 20:17:04 +0200 Message-Id: <20200826181706.11098-22-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 --- drivers/input/touchscreen/sis_i2c.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/input/touchscreen/sis_i2c.c b/drivers/input/touchscreen/sis_i2c.c index 6274555f1673..348a2ba9b7c9 100644 --- a/drivers/input/touchscreen/sis_i2c.c +++ b/drivers/input/touchscreen/sis_i2c.c @@ -311,23 +311,15 @@ static int sis_ts_probe(struct i2c_client *client, ts->attn_gpio = devm_gpiod_get_optional(&client->dev, "attn", GPIOD_IN); - if (IS_ERR(ts->attn_gpio)) { - error = PTR_ERR(ts->attn_gpio); - if (error != -EPROBE_DEFER) - dev_err(&client->dev, - "Failed to get attention GPIO: %d\n", error); - return error; - } + if (IS_ERR(ts->attn_gpio)) + return dev_err_probe(&client->dev, PTR_ERR(ts->attn_gpio), + "Failed to get attention GPIO\n"); ts->reset_gpio = devm_gpiod_get_optional(&client->dev, "reset", GPIOD_OUT_LOW); - if (IS_ERR(ts->reset_gpio)) { - error = PTR_ERR(ts->reset_gpio); - if (error != -EPROBE_DEFER) - dev_err(&client->dev, - "Failed to get reset GPIO: %d\n", error); - return error; - } + if (IS_ERR(ts->reset_gpio)) + return dev_err_probe(&client->dev, PTR_ERR(ts->reset_gpio), + "Failed to get reset GPIO\n"); sis_ts_reset(ts);