From patchwork Thu Aug 27 07:24:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11740153 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 6BD6C722 for ; Thu, 27 Aug 2020 07:25:55 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4648C22BEA for ; Thu, 27 Aug 2020 07:25:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="D7VTEcar"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="Yyeb8XSx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4648C22BEA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:To:From:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=XV/5qVHwD7i9qo3rSQ2875rssMMxKVEO/MU9xEl3WXw=; b=D7VTEcarQf0kiJ4I7S0mC8DZVF QAQa/e0zX7FOruV2Xxk3J0pgHhRXPZOQbr6l4xN63BXIn1Ax9vIN1sHHQ04m1I03RlGpZdi7Ps+5t UdEdqK7xUCqV5RwmQkoJ1g0i5vwO1zb6r7UuhFJ0KhE3PV17EXgFWdWAD1ndDT/6xqxn7en5j6aWs ns8rkWx99PTO0nZ3ilOJ/+PH0sdqcjJHv+LGpr7EwVZbBCg5kT3TlmPDD1Ja5b8uGMTM0Vm6DpD8V SDn78CoNY/sQO8MhZeMNWgj3CkBj8VouKq3SusQZ3ivyVR25OaBHhs5As0RmP/E7JDwiVIvwPGX3O a087JsiA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBCGr-0006Gu-H9; Thu, 27 Aug 2020 07:24:29 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBCGo-0006GB-RE for linux-arm-kernel@lists.infradead.org; Thu, 27 Aug 2020 07:24:27 +0000 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 0F41522BEB; Thu, 27 Aug 2020 07:24:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598513066; bh=S+YE0qEWx4yI9dTxKlN3BZj1KnlkIX5R53Okn/Sb7V4=; h=From:To:Subject:Date:From; b=Yyeb8XSxy68hcCJQxaJsRg1IUQoyJjvaZlMhByINmUddmrCaijr2C6IUTIwID5BLG nr9ZMOkzwV+8NaaLBwtp2LxnKZ4rlrQBehoXrtGlQxmhyDDZl/Uh9NG3jjK6a5NgyW HKR3sDP8cjc7CfUshPIqcC0cw3WvOexe4GHeBX94= From: Krzysztof Kozlowski To: Dmitry Torokhov , Maxime Ripard , Chen-Yu Tsai , Krzysztof Kozlowski , H Hartley Sweeten , Sebastian Reichel , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/4] Input: ep93xx_keypad - Fix handling of platform_get_irq() error Date: Thu, 27 Aug 2020 09:24:17 +0200 Message-Id: <20200827072420.22848-1-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200827_032426_961041_FBA2B787 X-CRM114-Status: GOOD ( 15.19 ) X-Spam-Score: -6.2 (------) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-6.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [198.145.29.99 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -1.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org platform_get_irq() returns -ERRNO on error. In such case comparison to 0 would pass the check. Fixes: 60214f058f44 ("Input: ep93xx_keypad - update driver to new core support") Signed-off-by: Krzysztof Kozlowski --- drivers/input/keyboard/ep93xx_keypad.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c index 7c70492d9d6b..f831f01501d5 100644 --- a/drivers/input/keyboard/ep93xx_keypad.c +++ b/drivers/input/keyboard/ep93xx_keypad.c @@ -250,8 +250,8 @@ static int ep93xx_keypad_probe(struct platform_device *pdev) } keypad->irq = platform_get_irq(pdev, 0); - if (!keypad->irq) { - err = -ENXIO; + if (keypad->irq < 0) { + err = keypad->irq; goto failed_free; } From patchwork Thu Aug 27 07:24:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11740149 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 9CB4D13B6 for ; Thu, 27 Aug 2020 07:25:52 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7601922BEA for ; Thu, 27 Aug 2020 07:25:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="H1WR5FuQ"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="oYzjjtis" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7601922BEA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=zioxng0M0bEtGiSPDG+ABFVH4uG7qZfVgt7mddMnnc8=; b=H1WR5FuQmn/u6s9nM4BY0rHrfI sqTvWXxM82fREoLt8sKwGgnfw5KdF5s9VboVUX+0Xc8nfFf7SFpQwJS0Y56FShgU4E1+oSitgDg2h kM+jm+/cG4rUljgzbG00cjXVQy6JzCEAMD6ezpdesfJitD21EgrZEUN7gnbX4HgWcacpmjX/HtGLw qqY+x9s9Lt9IixYR1PjiONLrEV+8+7TrZcfH+ZWSuIujB0zMobNYd1zE6sDSulJawr5q4gVTDhSh9 isppgzALPvoYnnOz5X/4tlJR5TmdBH2hl2dPi/Vjpq9PEXPPQUS+sX433yCKQFKes0JF58/uHBtMs fXPoXYFw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBCGv-0006IF-Sl; Thu, 27 Aug 2020 07:24:33 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBCGr-0006Go-Ci for linux-arm-kernel@lists.infradead.org; Thu, 27 Aug 2020 07:24:30 +0000 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 8E4BE22CB2; Thu, 27 Aug 2020 07:24:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598513068; bh=BAre5Tw2oDhiNLdO1XwfLZXiLzknbF3rmthL41mUOJU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=oYzjjtiseQtNWnGGOsgK7YAtZMOolN4ZF0lL9tr+mMeNr85khRXUPx3eoPJA+Z0d+ eREGXEEqk6f/GmjNkcpudOunQ8CmaRaJQTiULu0VmbQz9zpIBNeO2ntVtHofsqiVoI oC/t4BnDwVDunWSZFGgoA8dwE643pv3dgbm9wRhs= From: Krzysztof Kozlowski To: Dmitry Torokhov , Maxime Ripard , Chen-Yu Tsai , Krzysztof Kozlowski , H Hartley Sweeten , Sebastian Reichel , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/4] Input: omap4-keypad - Fix handling of platform_get_irq() error Date: Thu, 27 Aug 2020 09:24:18 +0200 Message-Id: <20200827072420.22848-2-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200827072420.22848-1-krzk@kernel.org> References: <20200827072420.22848-1-krzk@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200827_032429_534858_58467464 X-CRM114-Status: GOOD ( 14.52 ) X-Spam-Score: -6.2 (------) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-6.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [198.145.29.99 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -1.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org platform_get_irq() returns -ERRNO on error. In such case comparison to 0 would pass the check. Fixes: f3a1ba60dbdb ("Input: omap4-keypad - use platform device helpers") Signed-off-by: Krzysztof Kozlowski --- drivers/input/keyboard/omap4-keypad.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c index 94c94d7f5155..b075f1af0305 100644 --- a/drivers/input/keyboard/omap4-keypad.c +++ b/drivers/input/keyboard/omap4-keypad.c @@ -240,10 +240,8 @@ static int omap4_keypad_probe(struct platform_device *pdev) } irq = platform_get_irq(pdev, 0); - if (!irq) { - dev_err(&pdev->dev, "no keyboard irq assigned\n"); - return -EINVAL; - } + if (irq < 0) + return -irq; keypad_data = kzalloc(sizeof(struct omap4_keypad), GFP_KERNEL); if (!keypad_data) { From patchwork Thu Aug 27 07:24:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11740151 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 05A33722 for ; Thu, 27 Aug 2020 07:25:54 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D239E22BEA for ; Thu, 27 Aug 2020 07:25:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kIFDupXS"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="uWe6Q2kc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D239E22BEA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7UbzFSRTytcj+W2Of9daqZcBUGiBH/iW2tz2K+2Fj/w=; b=kIFDupXSmqeTCCbV4maK7FqdGW FE/pkH4wAOdw9M0P6UlAknnWkwx/EShOHbx+eBSusrQd7oc1iTmEBJrpd92YmYaNFudcunem5P9lQ sImaixO333uUu+RSHRpx8IzYEz72HaYhbsPiKwH78xH+huyqzM7FjdYWWvFao9qQF2e1ZjNoZv44N 8byjVfdGyg1KPwPq6jN6LgxI1VhjL+ujneLwiN4MmSio1+sSJ5dopZlau4+X7LVgPRVP7+IQ2QFpm G7kGgnu+SA2kjHKcecquO7F78ytXXbEoHEsPmHLLdlb5h/XZDaN6QfdQn/ZVaE3QEorxZ++j0KiUG SMnaJrlA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBCH2-0006KS-0v; Thu, 27 Aug 2020 07:24:40 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBCGt-0006Hd-Pv for linux-arm-kernel@lists.infradead.org; Thu, 27 Aug 2020 07:24:32 +0000 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 40DFC22BEA; Thu, 27 Aug 2020 07:24:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598513071; bh=QuoT6VS26Unir/WzzWse5ajubkYxK3aWXlHrQVEpwWg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=uWe6Q2kcJfZMrEQSrUvMiFOrHuCPKj4kRMlNSzbn8RE/9nxI333/gqFoYZOrEyJLz PcS3aODX9J3tQoYRo6YBZTDxeTjAGPNovxk+NZWJ/eys1b2n++JLKXrT+8Y3FAcbWN WrBKwv2SaoDk5O/MRuj3V4NX3Yhe/y4v9Of2hxLw= From: Krzysztof Kozlowski To: Dmitry Torokhov , Maxime Ripard , Chen-Yu Tsai , Krzysztof Kozlowski , H Hartley Sweeten , Sebastian Reichel , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/4] Input: twl4030_keypad - Fix handling of platform_get_irq() error Date: Thu, 27 Aug 2020 09:24:19 +0200 Message-Id: <20200827072420.22848-3-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200827072420.22848-1-krzk@kernel.org> References: <20200827072420.22848-1-krzk@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200827_032432_045107_81433516 X-CRM114-Status: GOOD ( 14.28 ) X-Spam-Score: -6.2 (------) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-6.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [198.145.29.99 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -1.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org platform_get_irq() returns -ERRNO on error. In such case comparison to 0 would pass the check. Fixes: 7abf38d6d13c ("Input: twl4030-keypad - add device tree support") Signed-off-by: Krzysztof Kozlowski Reported-by: kernel test robot --- drivers/input/keyboard/twl4030_keypad.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/input/keyboard/twl4030_keypad.c b/drivers/input/keyboard/twl4030_keypad.c index af3a6824f1a4..c971a06c2c6a 100644 --- a/drivers/input/keyboard/twl4030_keypad.c +++ b/drivers/input/keyboard/twl4030_keypad.c @@ -376,10 +376,8 @@ static int twl4030_kp_probe(struct platform_device *pdev) } kp->irq = platform_get_irq(pdev, 0); - if (!kp->irq) { - dev_err(&pdev->dev, "no keyboard irq assigned\n"); - return -EINVAL; - } + if (kp->irq < 0) + return kp->irq; error = matrix_keypad_build_keymap(keymap_data, NULL, TWL4030_MAX_ROWS, From patchwork Thu Aug 27 07:24:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11740147 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 7030D722 for ; Thu, 27 Aug 2020 07:24:54 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 49D2822BEA for ; Thu, 27 Aug 2020 07:24:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Nd6VW873"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="Xw9u5SeO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 49D2822BEA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=YhXJI/2djIkHbJFDoiG1giUZBnSJPGyHDm7dt69BceU=; b=Nd6VW8737FKxNbsbuGrh5fyJX4 qArES0mpuezRdjANUl8NhoUGUsh/aIY2pC98vqsoL0U7nYnHW0LfjamREo0+d6hHL048u/wgRX/6B hoGNP4CSX8xOC/aPIsieVjpaaxsQ+6OAMaZq/LfnOGz5N51QhYf87rKXSPZuDQapCquG6ePxUSVGv Y6PiJ0B+VKqzuNuKKFZRTo8NB4h3MQ3DKR0WO1oHYksN+7b3MQFkX5vAIgV0GyHwtvRLPT8FK35xF kBSexz2SJnJIUFnh0VLwHlo8oACJNqAxsCMrs1o2ww46geUXcHkZve3QlXDudXqz53j0VfUKxqEUn k0NGWQYQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBCH6-0006LV-8V; Thu, 27 Aug 2020 07:24:44 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBCGw-0006IP-GT for linux-arm-kernel@lists.infradead.org; Thu, 27 Aug 2020 07:24:35 +0000 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 99D8322CAE; Thu, 27 Aug 2020 07:24:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598513073; bh=21SE16AO2Es2A0sU9De9UcqocFt/7Hk8g8DosPEVjfY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Xw9u5SeO93ZZx+JOSuMX/gbqTO3X6kMuoQYc4Ye86pEPZIiWSEzt9kYa0u7NxqBM2 lwH7M3bbO0srhU4CLwJFw0EZAE0+2oV9FdfNFqtd3My5plcK27QVjNggTHDeC3u//o EQhIzI+1E5r2YQ3Kgem8UfhIDztvYAUatAMPfUFQ= From: Krzysztof Kozlowski To: Dmitry Torokhov , Maxime Ripard , Chen-Yu Tsai , Krzysztof Kozlowski , H Hartley Sweeten , Sebastian Reichel , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 4/4] Input: sun4i-ps2 - Fix handling of platform_get_irq() error Date: Thu, 27 Aug 2020 09:24:20 +0200 Message-Id: <20200827072420.22848-4-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200827072420.22848-1-krzk@kernel.org> References: <20200827072420.22848-1-krzk@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200827_032434_659196_3F6EC6D6 X-CRM114-Status: GOOD ( 14.76 ) X-Spam-Score: -6.2 (------) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-6.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [198.145.29.99 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -1.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org platform_get_irq() returns -ERRNO on error. In such case comparison to 0 would pass the check. Fixes: e443631d20f5 ("Input: serio - add support for Alwinner A10/A20 PS/2 controller") Signed-off-by: Krzysztof Kozlowski --- drivers/input/serio/sun4i-ps2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/input/serio/sun4i-ps2.c b/drivers/input/serio/sun4i-ps2.c index a681a2c04e39..7da1ea8741fc 100644 --- a/drivers/input/serio/sun4i-ps2.c +++ b/drivers/input/serio/sun4i-ps2.c @@ -265,9 +265,8 @@ static int sun4i_ps2_probe(struct platform_device *pdev) /* Get IRQ for the device */ irq = platform_get_irq(pdev, 0); - if (!irq) { - dev_err(dev, "no IRQ found\n"); - error = -ENXIO; + if (irq < 0) { + error = irq; goto err_disable_clk; }