From patchwork Wed Aug 26 18:16:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11739267 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 C5F1E13B6 for ; Wed, 26 Aug 2020 18:17:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AC483208E4 for ; Wed, 26 Aug 2020 18:17:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465839; bh=fotpd/goB8x161LaxWE7cPWJ2+c6Vmm0EGcW3JpQGWI=; h=From:To:Cc:Subject:Date:List-ID:From; b=ezRRsm8OSqXMSoVUhiCewXqKfemdTwXnPJMNqa6D9LqAmnXQjdCnwauF8/rDlRpWC BiwEdCk5064ahAuY9+8n5oJeMTSYGN53g+tUM7+MLG/Cm+lxjPtl8TWklNOlscM7rg R8J0jByOT8rEdH7S0PRbVi/B/whTW5X4Wk9dhUdg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726734AbgHZSRS (ORCPT ); Wed, 26 Aug 2020 14:17:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:39424 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726241AbgHZSRR (ORCPT ); Wed, 26 Aug 2020 14:17:17 -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 706AD20737; Wed, 26 Aug 2020 18:17:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465836; bh=fotpd/goB8x161LaxWE7cPWJ2+c6Vmm0EGcW3JpQGWI=; h=From:To:Cc:Subject:Date:From; b=FXyal6QV6uvVCxpGkD1cCsgr5aDrmD/lJTMEAIEk3a1ohHIy+UF+l3CkanBnm4daS Q9Cae6ndODk+P0bz2Y2uHyi1dR9NyJmyT0vT0IeYOD6cazmgJmusUO4Y74Ffg6V7oN pf+Rjhb2if6DCmsxK17r2Dp6DNUg6bQTjC3ZN1Bc= 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 01/24] Input: bcm-keypad - Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 20:16:43 +0200 Message-Id: <20200826181706.11098-1-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 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: Hans de Goede --- drivers/input/keyboard/bcm-keypad.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/input/keyboard/bcm-keypad.c b/drivers/input/keyboard/bcm-keypad.c index 2b771c3a5578..1bf71e7c9e0d 100644 --- a/drivers/input/keyboard/bcm-keypad.c +++ b/drivers/input/keyboard/bcm-keypad.c @@ -379,11 +379,9 @@ static int bcm_kp_probe(struct platform_device *pdev) kp->clk = devm_clk_get(&pdev->dev, "peri_clk"); if (IS_ERR(kp->clk)) { error = PTR_ERR(kp->clk); - if (error != -ENOENT) { - if (error != -EPROBE_DEFER) - dev_err(&pdev->dev, "Failed to get clock\n"); - return error; - } + if (error != -ENOENT) + return dev_err_probe(&pdev->dev, error, "Failed to get clock\n"); + dev_dbg(&pdev->dev, "No clock specified. Assuming it's enabled\n"); kp->clk = NULL; 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: 11739271 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 AA2181731 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 887AF22B43 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:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11739275 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 F10741731 for ; Wed, 26 Aug 2020 18:17:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DA5C6214F1 for ; Wed, 26 Aug 2020 18:17:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465853; bh=TiIrBmN1ONi32fa4mRcnLGuieT5Nl7bSCxSC4PoSTzk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=GF193+zbgLq3VWIFaCsx7zkmc15CwLf3AiDTl2+dl08uQ5DILeqt1BlxgsUmrTZ1y dWKSWPdMOxmhKt91qI17n41DZR2TUeuezK4ofipQBfBznT4b23ukCBjgF2hRjgc3Ny uojBj72YaYy46rlVZA4eExI2957gyMb2QLEL97i4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726940AbgHZSRb (ORCPT ); Wed, 26 Aug 2020 14:17:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:39832 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726880AbgHZSR1 (ORCPT ); Wed, 26 Aug 2020 14:17:27 -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 7A164208E4; Wed, 26 Aug 2020 18:17:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465847; bh=TiIrBmN1ONi32fa4mRcnLGuieT5Nl7bSCxSC4PoSTzk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZZO5SlWvjTrCiD6iyjn4f+q3YCxVbTXwCS87P9oriwT8n5rVtd0bNP9Jg3CMmH+C9 urThHpiJAUtBGrV3yMy26stL6qsNaSFnFQzKomWLHhNyhxG1FvuRDHuJsHy0IUkFXC /03lSd0CFt6070MWGRfWEB7BXOJ0//sJGpEkuscQ= 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 03/24] Input: gpio_keys_polled - Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 20:16:45 +0200 Message-Id: <20200826181706.11098-3-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/keyboard/gpio_keys_polled.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/input/keyboard/gpio_keys_polled.c b/drivers/input/keyboard/gpio_keys_polled.c index c3937d2fc744..ba00ecfbd343 100644 --- a/drivers/input/keyboard/gpio_keys_polled.c +++ b/drivers/input/keyboard/gpio_keys_polled.c @@ -299,13 +299,9 @@ static int gpio_keys_polled_probe(struct platform_device *pdev) NULL, GPIOD_IN, button->desc); if (IS_ERR(bdata->gpiod)) { - error = PTR_ERR(bdata->gpiod); - if (error != -EPROBE_DEFER) - dev_err(dev, - "failed to get gpio: %d\n", - error); fwnode_handle_put(child); - return error; + return dev_err_probe(dev, PTR_ERR(bdata->gpiod), + "failed to get gpio\n"); } } else if (gpio_is_valid(button->gpio)) { /* From patchwork Wed Aug 26 18:16:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11739355 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 9CD0E1731 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 7B5A722B40 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=R/wON7Dd1kYOf9N5F6c4o26RPuVpWmsv1WDvdKWb24A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=b6d6NqZLmSc/Zvuk4rsthUEX3e2jKdskv8Ny+yKQ3wm1MBtUuhZdrYbtxeiYmCFE7 BvDIwebGaBuDUvw7zZtqPCQMjDBuAeRGTx5AQM4URVuJ6kFdPfzXzOlJvbTQwJC0+x tY58RLJw6qy7pVkbF+JjkvbXK/alXqiVgkMB6eHA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726953AbgHZSRf (ORCPT ); Wed, 26 Aug 2020 14:17:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:39978 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726947AbgHZSRc (ORCPT ); Wed, 26 Aug 2020 14:17: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 359A020737; 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=1598465852; bh=R/wON7Dd1kYOf9N5F6c4o26RPuVpWmsv1WDvdKWb24A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kurPqRyWew4kwvgkIRJu5txJPZdqjY6ppdsSeovEc+/Oqllkxg8lZxG1k2gxFX5SH 1O3ROXotMDmNy76N8wzyEcPSOJEWeyiT+B/K6M30RRsq4mLB45AcKR2GDGvKXMi9Zk 4Pa287LfJy6LjPXa2VYux/jxgJ25qVTlGyd8mldg= 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 04/24] Input: gpio-vibra - Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 20:16:46 +0200 Message-Id: <20200826181706.11098-4-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/gpio-vibra.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/input/misc/gpio-vibra.c b/drivers/input/misc/gpio-vibra.c index f79f75595dd7..53042e0ba9ee 100644 --- a/drivers/input/misc/gpio-vibra.c +++ b/drivers/input/misc/gpio-vibra.c @@ -114,21 +114,13 @@ static int gpio_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\n", - err); - return err; - } + if (err) + return dev_err_probe(&pdev->dev, err, "Failed to request regulator\n"); vibrator->gpio = devm_gpiod_get(&pdev->dev, "enable", GPIOD_OUT_LOW); err = PTR_ERR_OR_ZERO(vibrator->gpio); - if (err) { - if (err != -EPROBE_DEFER) - dev_err(&pdev->dev, "Failed to request main gpio: %d\n", - err); - return err; - } + if (err) + return dev_err_probe(&pdev->dev, err, "Failed to request main gpio\n"); INIT_WORK(&vibrator->play_work, gpio_vibrator_play_work); From patchwork Wed Aug 26 18:16:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11739285 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 ED7D3913 for ; Wed, 26 Aug 2020 18:18:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C907F22B4B for ; Wed, 26 Aug 2020 18:18:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465880; bh=qIxzQTne6y0qZdRLOwKO8AtpCeZ51Mwuxugkramq3r4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=K8bCcYK0bxhBJZDcJVV0d4ALQBbFyH8OXrjuBje80bDcH0T3EPS9fT9D3xV+VtbXo hK5on+G/dT/YLac+SzolYJ8CHqp0Y+NM1diz2CKgIfje3AoFZFklsTPrBycM2Vy3r8 8RH6wi6/phB0kROAN3WTHuZKkgBuf4YpfrBGodeY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727003AbgHZSRj (ORCPT ); Wed, 26 Aug 2020 14:17:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:40152 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726988AbgHZSRh (ORCPT ); Wed, 26 Aug 2020 14:17:37 -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 85CCE20786; Wed, 26 Aug 2020 18:17:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465857; bh=qIxzQTne6y0qZdRLOwKO8AtpCeZ51Mwuxugkramq3r4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iznPRqJXhF1sfCAosHrglMY2+nUq+qC/BMTRB1Wz3OYhbMi47Ie56wiJaD1Vikkrv s49VIa1V9mElFYrKLb+Tu4+ksVzgZiuJMzjcw2uwgbwJbWUzK9Cy8PRXxl0/32q5Oq BQp6Z2bAd/nYCCEKYppLU1uVg6fHlV+u9UCZmp08= 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 05/24] Input: pwm-beeper - Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 20:16:47 +0200 Message-Id: <20200826181706.11098-5-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/misc/pwm-beeper.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/drivers/input/misc/pwm-beeper.c b/drivers/input/misc/pwm-beeper.c index d6b12477748a..8c0085e8c552 100644 --- a/drivers/input/misc/pwm-beeper.c +++ b/drivers/input/misc/pwm-beeper.c @@ -132,13 +132,8 @@ static int pwm_beeper_probe(struct platform_device *pdev) return -ENOMEM; beeper->pwm = devm_pwm_get(dev, NULL); - if (IS_ERR(beeper->pwm)) { - error = PTR_ERR(beeper->pwm); - if (error != -EPROBE_DEFER) - dev_err(dev, "Failed to request PWM device: %d\n", - error); - return error; - } + if (IS_ERR(beeper->pwm)) + return dev_err_probe(dev, PTR_ERR(beeper->pwm), "Failed to request PWM device\n"); /* Sync up PWM state and ensure it is off. */ pwm_init_state(beeper->pwm, &state); @@ -151,13 +146,9 @@ static int pwm_beeper_probe(struct platform_device *pdev) } beeper->amplifier = devm_regulator_get(dev, "amp"); - if (IS_ERR(beeper->amplifier)) { - error = PTR_ERR(beeper->amplifier); - if (error != -EPROBE_DEFER) - dev_err(dev, "Failed to get 'amp' regulator: %d\n", - error); - return error; - } + if (IS_ERR(beeper->amplifier)) + return dev_err_probe(dev, PTR_ERR(beeper->amplifier), + "Failed to get 'amp' regulator\n"); INIT_WORK(&beeper->work, pwm_beeper_work); 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: 11739283 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 85268913 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 62417208E4 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: 11739357 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 CBB98138A 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 B41D622B40 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 Reviewed-by: Andy Shevchenko --- 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: 11739353 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 76CBF13B6 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 544AC20737 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 Reviewed-by: Andy Shevchenko --- 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: 11739291 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 E3ECC913 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 C2DE4214F1 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:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11739293 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 36099913 for ; Wed, 26 Aug 2020 18:18:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0F46F208E4 for ; Wed, 26 Aug 2020 18:18:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465896; bh=yUWk4mxpG57bJBzNpi9hhgtOa+YH60rJgWNHNjOCKYU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=pog8TJKYoZDROeX7+SedUFbOHdyCHw/GnvmfVUOkILDIiLbxFwsJypBq9o8HoFSiD BL3qjOMAc6IezsIryhmpMYyrTLl1ja+MgjMBdGR0DxBGZobvf1chOaYAAXNoiT8U35 8wD/mdVQrKSXhSeo03V0OktzZ+yhn4af917dzl24= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727112AbgHZSSO (ORCPT ); Wed, 26 Aug 2020 14:18:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:41346 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727103AbgHZSSI (ORCPT ); Wed, 26 Aug 2020 14:18:08 -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 E75A7207BC; Wed, 26 Aug 2020 18:18:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465887; bh=yUWk4mxpG57bJBzNpi9hhgtOa+YH60rJgWNHNjOCKYU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mzA/IFNvdnNL84fmvXjdwguBJmeSPEKraTBzx3+o5u5pKwo6uIJ0SfByLdgw7DzOO Ysnr5vvRwzUbbTjd5Gy3qNk6QanQaBGlOE92WtwUKV4DwXHcwQSLbauOZrwipujpE9 mfymSLWIZsaC9Zk1S7jRY/bTvxVnVrXuRZVkzef4= 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 10/24] Input: bu21029_ts - Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 20:16:52 +0200 Message-Id: <20200826181706.11098-10-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/bu21029_ts.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/input/touchscreen/bu21029_ts.c b/drivers/input/touchscreen/bu21029_ts.c index 49a8d4bbca3a..96c178b606dc 100644 --- a/drivers/input/touchscreen/bu21029_ts.c +++ b/drivers/input/touchscreen/bu21029_ts.c @@ -360,23 +360,15 @@ static int bu21029_probe(struct i2c_client *client, } bu21029->vdd = devm_regulator_get(&client->dev, "vdd"); - if (IS_ERR(bu21029->vdd)) { - error = PTR_ERR(bu21029->vdd); - if (error != -EPROBE_DEFER) - dev_err(&client->dev, - "failed to acquire 'vdd' supply: %d\n", error); - return error; - } + if (IS_ERR(bu21029->vdd)) + return dev_err_probe(&client->dev, PTR_ERR(bu21029->vdd), + "failed to acquire 'vdd' supply\n"); bu21029->reset_gpios = devm_gpiod_get_optional(&client->dev, "reset", GPIOD_OUT_HIGH); - if (IS_ERR(bu21029->reset_gpios)) { - error = PTR_ERR(bu21029->reset_gpios); - if (error != -EPROBE_DEFER) - dev_err(&client->dev, - "failed to acquire 'reset' gpio: %d\n", error); - return error; - } + if (IS_ERR(bu21029->reset_gpios)) + return dev_err_probe(&client->dev, PTR_ERR(bu21029->reset_gpios), + "failed to acquire 'reset' gpio\n"); in_dev = devm_input_allocate_device(&client->dev); if (!in_dev) { 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: 11739297 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 A98FA13B6 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 88E25214F1 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 Reviewed-by: Andy Shevchenko --- 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:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11739301 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 0EEE813B6 for ; Wed, 26 Aug 2020 18:18:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E8DE622B43 for ; Wed, 26 Aug 2020 18:18:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465906; bh=aDmvqHlQZkrMxJWIZ3K/qfQvR2zitB02kM6hwU97zPg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=GesbRufqEJNRNZSWBJFph6iDL1SlmMd60w2sVWVmSrizByIhd62KSpHXrqu27L/IZ tlJp4RQLm/TwI0ljpWkBjY1rkhMrTDdBN2HoyODnJKa2Db8XRbMjEuRHpKeFV3ppVQ KEJhVgke3P4EYJgWo+tDrVKvWlw3V/Tsx6BbjeCk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727786AbgHZSSS (ORCPT ); Wed, 26 Aug 2020 14:18:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:41704 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727772AbgHZSSQ (ORCPT ); Wed, 26 Aug 2020 14:18:16 -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 5EA76207BC; Wed, 26 Aug 2020 18:18:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465896; bh=aDmvqHlQZkrMxJWIZ3K/qfQvR2zitB02kM6hwU97zPg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xsiumwCLu2SlMtdlk+MK3PTQ2NzSAgquDGVZLE1MAaGAIz0G3kswIPur0kr7hpe1T X1dsyEb0pmVZAmL2HFrv7oAE4BR53+PwzLSs7f7KdhWfz6yh2og9PJNOVUbR8GYBy7 bydwX79WwjbYLTQyZZg1JiVrcAKd4wr/0pOho1uc= 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 12/24] Input: cy8ctma140 - Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 20:16:54 +0200 Message-Id: <20200826181706.11098-12-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 Acked-by: Linus Walleij --- drivers/input/touchscreen/cy8ctma140.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/input/touchscreen/cy8ctma140.c b/drivers/input/touchscreen/cy8ctma140.c index a9be29139cbf..23da5bb00ead 100644 --- a/drivers/input/touchscreen/cy8ctma140.c +++ b/drivers/input/touchscreen/cy8ctma140.c @@ -259,12 +259,8 @@ static int cy8ctma140_probe(struct i2c_client *client, ts->regulators[1].supply = "vdd"; error = devm_regulator_bulk_get(dev, ARRAY_SIZE(ts->regulators), ts->regulators); - if (error) { - if (error != -EPROBE_DEFER) - dev_err(dev, "Failed to get regulators %d\n", - error); - return error; - } + if (error) + return dev_err_probe(dev, error, "Failed to get regulators\n"); error = cy8ctma140_power_up(ts); if (error) From patchwork Wed Aug 26 18:16:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11739349 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 5ABA4138A for ; Wed, 26 Aug 2020 18:20:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 36DEB20786 for ; Wed, 26 Aug 2020 18:20:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598466001; bh=/MVD81Dk9a9N8i8v4eBsnioXxC7T8r+SLsxSVtXZhEA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=otQXPCDpDVfDLjIm9isTESiQjJsK1uQiSPCFcaBH9lRaoYK4jCy23NoAUgLtuGyCS FSTVCpiHvC+g4u9qBqPfe/lrd+wv6OCWcJuQs75EGlr9NwuLck/9bh7bnhWSojxZKd v/X81cc6zvaIB13vgKuZm07wH49SDvbKIhd1kKtc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727851AbgHZST6 (ORCPT ); Wed, 26 Aug 2020 14:19:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:41926 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727794AbgHZSSV (ORCPT ); Wed, 26 Aug 2020 14:18: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 EE49C2083B; Wed, 26 Aug 2020 18:18:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465901; bh=/MVD81Dk9a9N8i8v4eBsnioXxC7T8r+SLsxSVtXZhEA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a5whlNufmpP7lRPlL+rG4uzwsAtu9iYP3on3k/DYmbaOa9YW3+AFwZq7f+T/8luiA hHsJ1uIQ81vCNO8Q/rgvmt5cf3vY13wrCqoUPOrcYhWsrOKNqIBcZgYw57qoubbZcU BreZZCgcxExZXnCjzjBGvs/iP4Rf9JAqMHaUDO8w= 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 13/24] Input: edf-ft5x06 - Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 20:16:55 +0200 Message-Id: <20200826181706.11098-13-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/edt-ft5x06.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index 6ff81d48da86..d4827ac963b0 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -1098,13 +1098,9 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client, tsdata->max_support_points = chip_data->max_support_points; tsdata->vcc = devm_regulator_get(&client->dev, "vcc"); - if (IS_ERR(tsdata->vcc)) { - error = PTR_ERR(tsdata->vcc); - if (error != -EPROBE_DEFER) - dev_err(&client->dev, - "failed to request regulator: %d\n", error); - return error; - } + if (IS_ERR(tsdata->vcc)) + return dev_err_probe(&client->dev, PTR_ERR(tsdata->vcc), + "failed to request regulator\n"); error = regulator_enable(tsdata->vcc); if (error < 0) { 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: 11739303 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 C836F913 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 A63EE214F1 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 Reviewed-by: Andy Shevchenko --- 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:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11739305 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 2064013B6 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 F31C022B49 for ; Wed, 26 Aug 2020 18:18:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465917; bh=esFsNTUfCxBJtaN0CSI6BtiDlFy0zInX6pkriROGYdw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=w0QMyjj1crPpBZtHZSV9fahUVZC4hie/tAa76cAAvaLxSflhB33W4AblE7CNS/5Sg bFLPW9ie6dD85ocanCyR57P4Msd4TRgrIjeCJBI6fIqMjAtSYK6YDpRPffJbLRzDJF RB9XHTcRjQB7KvHehRPkfbL/3U6IArjyqLsr3DBs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727827AbgHZSSf (ORCPT ); Wed, 26 Aug 2020 14:18:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:42224 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727815AbgHZSS2 (ORCPT ); Wed, 26 Aug 2020 14:18:28 -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 52FF1214F1; Wed, 26 Aug 2020 18:18:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465908; bh=esFsNTUfCxBJtaN0CSI6BtiDlFy0zInX6pkriROGYdw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UzIhZG7XtyqfchxrNXADPABduEGpqWHX8oJFpMFrxB0ku7rQfV7RzeOBYTZ1afzog QdMW1s7VTuxAV3vUPtvvmM6qX1NXfzZ6+9a3XGzplEwmKE1mgEJvPMgxDfAeHiVWt3 xAmyf15Ue/JT0EWpfIp6xS98yPX22odlNLLZ6xnE= 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 15/24] Input: elants_i2c - Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 20:16:57 +0200 Message-Id: <20200826181706.11098-15-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/elants_i2c.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c index b0bd5bb079be..ad299eb333f1 100644 --- a/drivers/input/touchscreen/elants_i2c.c +++ b/drivers/input/touchscreen/elants_i2c.c @@ -1245,24 +1245,14 @@ static int elants_i2c_probe(struct i2c_client *client, i2c_set_clientdata(client, ts); ts->vcc33 = devm_regulator_get(&client->dev, "vcc33"); - if (IS_ERR(ts->vcc33)) { - error = PTR_ERR(ts->vcc33); - if (error != -EPROBE_DEFER) - dev_err(&client->dev, - "Failed to get 'vcc33' regulator: %d\n", - error); - return error; - } + if (IS_ERR(ts->vcc33)) + return dev_err_probe(&client->dev, PTR_ERR(ts->vcc33), + "Failed to get 'vcc33' 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(&client->dev, "reset", GPIOD_OUT_LOW); if (IS_ERR(ts->reset_gpio)) { 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: 11739307 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 728691731 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 5A58722B43 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 Reviewed-by: Andy Shevchenko --- 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:16:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11739311 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 6ADDC913 for ; Wed, 26 Aug 2020 18:18:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4525C22B47 for ; Wed, 26 Aug 2020 18:18:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465920; bh=db6cAfvHR7hZaShwMgbp+kK+nTUH1aoOV5Yzheh1ExU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Tc6SIaqINHkUX3CR8Nl9qeAEXDgNZV5iSfzk8/P6q03FxKt4hk0l2p+mKKnAJb24U V4HbsQvOwtGOuHe16euYfqoMkKj3bENKCF86nqTZ1rjIpvvZBDMQwlWlB189eNXfzc uUSAwFuMzhR5YyXR5p/6Qu5sbVx5CkFcCDz4ErjM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727839AbgHZSSg (ORCPT ); Wed, 26 Aug 2020 14:18:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:42494 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727831AbgHZSSg (ORCPT ); Wed, 26 Aug 2020 14:18:36 -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 30C34207BC; Wed, 26 Aug 2020 18:18:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465914; bh=db6cAfvHR7hZaShwMgbp+kK+nTUH1aoOV5Yzheh1ExU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hPPV10IzLm1EAVanzbPGYA7h1sr/WM621NwqedlyHuX8QIVSrgaatjQ0m4DACkeeo lG9pV4TogIuqTuYrE4Lj9xoqOQyTme2lAvm1qJswIOnHvYaTqQEdpPfPdeDjVAf8ri 8Yabty8B7O7FsQ7w71MWudj+DFc0sVNj3vzV1vXg= 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 17/24] Input: melfas_mip4 - Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 20:16:59 +0200 Message-Id: <20200826181706.11098-17-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/melfas_mip4.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/input/touchscreen/melfas_mip4.c b/drivers/input/touchscreen/melfas_mip4.c index f67efdd040b2..d43a8643adcd 100644 --- a/drivers/input/touchscreen/melfas_mip4.c +++ b/drivers/input/touchscreen/melfas_mip4.c @@ -1451,13 +1451,8 @@ static int mip4_probe(struct i2c_client *client, const struct i2c_device_id *id) ts->gpio_ce = devm_gpiod_get_optional(&client->dev, "ce", GPIOD_OUT_LOW); - if (IS_ERR(ts->gpio_ce)) { - error = PTR_ERR(ts->gpio_ce); - if (error != EPROBE_DEFER) - dev_err(&client->dev, - "Failed to get gpio: %d\n", error); - return error; - } + if (IS_ERR(ts->gpio_ce)) + return dev_err_probe(&client->dev, PTR_ERR(ts->gpio_ce), "Failed to get gpio\n"); error = mip4_power_on(ts); if (error) 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: 11739343 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 4D56F13B6 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 35ECC20786 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 Reviewed-by: Andy Shevchenko --- 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: 11739333 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 8628B913 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 653D220737 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 Reviewed-by: Andy Shevchenko --- 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: 11739317 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 5BBD5913 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 3AAB2207BC 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 Reviewed-by: Andy Shevchenko --- 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: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) 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: 11739325 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 B6980913 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 9D9F120737 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 Reviewed-by: Andy Shevchenko --- 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); From patchwork Wed Aug 26 18:17:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11739329 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 CAB271731 for ; Wed, 26 Aug 2020 18:19:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B3AF720737 for ; Wed, 26 Aug 2020 18:19:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465979; bh=/FkqaqIXZzbXcSTu05JXN8zxrYdqxFmLMeqEbZbaSRA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=BHXMApwoWsDaaK9v1dPfBsPWA59XWlup7HZe94oVaVZjsvM3N/mBMhVe5aGZLySzV LTO3ejm03IMpFlCym5c63D/Wme/Ylt/taRgvWZKJUqFSovRqTBzlhwBzo8hyyMDUZt A1SdB6l5uwaBkvMf826/IeT0MFtqMET3UQT48Ekc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727926AbgHZSS4 (ORCPT ); Wed, 26 Aug 2020 14:18:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:43336 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727919AbgHZSSy (ORCPT ); Wed, 26 Aug 2020 14:18:54 -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 63936207BC; Wed, 26 Aug 2020 18:18:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465934; bh=/FkqaqIXZzbXcSTu05JXN8zxrYdqxFmLMeqEbZbaSRA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=06p6JI0CrZMQzNjpp2j1O2a/1td+bpk6bQoJR98SDTin+KM7qKpyiQ7lCPL8UJG/B yaVugQ9q9hBo2021b97piey1GLeGcmVphlu8oozFilhbpNMgGd4VXF3XyyzhAD3VzB iYboRS5ZSDDIAR35JXMqx8UQXvX3fainUSrUJizk= 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 23/24] Input: surface3_spi - Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 20:17:05 +0200 Message-Id: <20200826181706.11098-23-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/surface3_spi.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/input/touchscreen/surface3_spi.c b/drivers/input/touchscreen/surface3_spi.c index ce4828b1415a..25bb77ddf2ef 100644 --- a/drivers/input/touchscreen/surface3_spi.c +++ b/drivers/input/touchscreen/surface3_spi.c @@ -223,7 +223,6 @@ static void surface3_spi_power(struct surface3_ts_data *data, bool on) */ static int surface3_spi_get_gpio_config(struct surface3_ts_data *data) { - int error; struct device *dev; struct gpio_desc *gpiod; int i; @@ -233,15 +232,9 @@ static int surface3_spi_get_gpio_config(struct surface3_ts_data *data) /* Get the reset lines GPIO pin number */ for (i = 0; i < 2; i++) { gpiod = devm_gpiod_get_index(dev, NULL, i, GPIOD_OUT_LOW); - if (IS_ERR(gpiod)) { - error = PTR_ERR(gpiod); - if (error != -EPROBE_DEFER) - dev_err(dev, - "Failed to get power GPIO %d: %d\n", - i, - error); - return error; - } + if (IS_ERR(gpiod)) + return dev_err_probe(dev, PTR_ERR(gpiod), + "Failed to get power GPIO %d\n", i); data->gpiod_rst[i] = gpiod; } From patchwork Wed Aug 26 18:17:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11739321 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 9AF7413B6 for ; Wed, 26 Aug 2020 18:19:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7559A214F1 for ; Wed, 26 Aug 2020 18:19:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465943; bh=IUvTqqXBFc4hRe8hE39JcMQiPU85dhjMfKQTxHNFxas=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=zx0XwGLKcJmDCgEonC2C0FvYDk3PwtVEIn8DPMbRJFlGOPjcjOIIEbKhk6/KwXDrb UMmKgnCfa4T1JTD2J1U+0bla2C1P2sdMNJ2aM4Jbzgq7izPCrHCVkUw/Rp6bmEUfuW 1W/cpoOjaQM9fi4WNizJ49qlv6Ciusye5jjJxNes= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727944AbgHZSTB (ORCPT ); Wed, 26 Aug 2020 14:19:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:43492 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727937AbgHZSS5 (ORCPT ); Wed, 26 Aug 2020 14:18: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 66921214F1; Wed, 26 Aug 2020 18:18:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598465937; bh=IUvTqqXBFc4hRe8hE39JcMQiPU85dhjMfKQTxHNFxas=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WfADOt/TlUwzElF8vASKklglMVOxWZhclG0AOj7/fTodFk6dogEnDdIvtp/4g4bnv nEhaXLlXSZe/gB4AOMS5FVFjL/3KpSonsWT9JLBivFJYWSNa2HYazJHuLm6q5QbwUB 6yBSk+sK1pU/Oxb0ir9kS8sicymtREOp73Wkcxkw= 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 24/24] Input: sx8643 - Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 20:17:06 +0200 Message-Id: <20200826181706.11098-24-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/sx8654.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/input/touchscreen/sx8654.c b/drivers/input/touchscreen/sx8654.c index de85e57b2486..d2ed9be64c3a 100644 --- a/drivers/input/touchscreen/sx8654.c +++ b/drivers/input/touchscreen/sx8654.c @@ -323,13 +323,9 @@ static int sx8654_probe(struct i2c_client *client, sx8654->gpio_reset = devm_gpiod_get_optional(&client->dev, "reset", GPIOD_OUT_HIGH); - if (IS_ERR(sx8654->gpio_reset)) { - error = PTR_ERR(sx8654->gpio_reset); - if (error != -EPROBE_DEFER) - dev_err(&client->dev, "unable to get reset-gpio: %d\n", - error); - return error; - } + if (IS_ERR(sx8654->gpio_reset)) + return dev_err_probe(&client->dev, PTR_ERR(sx8654->gpio_reset), + "unable to get reset-gpio\n"); dev_dbg(&client->dev, "got GPIO reset pin\n"); sx8654->data = device_get_match_data(&client->dev);