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: 11740139 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 D52F313B6 for ; Thu, 27 Aug 2020 07:24:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BA00E22BF3 for ; Thu, 27 Aug 2020 07:24:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598513067; bh=S+YE0qEWx4yI9dTxKlN3BZj1KnlkIX5R53Okn/Sb7V4=; h=From:To:Subject:Date:List-ID:From; b=zDgzR7iOjM5zvMWzJH1l3xzActoc7cX7GfT+lhQ9HwCr2v9Mbkm/xxWlk4UsJ/UrD 0ThUVUxONg/c1kcdsFKEMI4S+a6XgXAm+SKi/AA7wXrdR1aYKSCbHJVlG+hfB1Rqm+ aWeETeCmJDNLLacxXFKleQ27GoICTxSuA6Cz6eeE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728033AbgH0HY0 (ORCPT ); Thu, 27 Aug 2020 03:24:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:32852 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726882AbgH0HY0 (ORCPT ); Thu, 27 Aug 2020 03:24:26 -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 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 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.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: 11740141 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 21AB1722 for ; Thu, 27 Aug 2020 07:24:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0352822BF3 for ; Thu, 27 Aug 2020 07:24:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598513075; bh=BAre5Tw2oDhiNLdO1XwfLZXiLzknbF3rmthL41mUOJU=; h=From:To:Subject:Date:In-Reply-To:References:List-ID:From; b=pCZ3S6V8vNfvh2W0K1UjDJzVvG8cHH+ZyJ6x8/GYVA8NJ/d95hifBofFNRlO6AbH+ PRwDMrdPnhX8F1YTlTfRkiOnKfnBRbqPkMjfjwSFH+mrsMIz14ElZkwm5x0AXJuIcP jvgmstKYhBU4bZYAv82cveY9xg6wi0OAzmDIrT6I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728081AbgH0HYe (ORCPT ); Thu, 27 Aug 2020 03:24:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:32960 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726882AbgH0HY3 (ORCPT ); Thu, 27 Aug 2020 03:24:29 -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 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> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.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: 11740145 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 51E4F13B6 for ; Thu, 27 Aug 2020 07:24:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 34A8522BEB for ; Thu, 27 Aug 2020 07:24:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598513085; bh=QuoT6VS26Unir/WzzWse5ajubkYxK3aWXlHrQVEpwWg=; h=From:To:Subject:Date:In-Reply-To:References:List-ID:From; b=ckCe2OBQcVC4iTZ2VfhDMm4CCRuSatMwfd4Mr0iVDHtZYfDwjq0kOD6KpRpF4D564 ZGGUJDZf1AFSrqLCWoKucuHStzh41Jc+VTRa46Fo9ul1oDW1dA4dmmhmucAGIilVND 6Kx+3w8ZuZfMqDWAORfglvdgiKbDMilAfsmg2GtI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728114AbgH0HYe (ORCPT ); Thu, 27 Aug 2020 03:24:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:33090 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728029AbgH0HYb (ORCPT ); Thu, 27 Aug 2020 03:24:31 -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 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> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.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: 11740143 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 4DCE71731 for ; Thu, 27 Aug 2020 07:24:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 369B122CB1 for ; Thu, 27 Aug 2020 07:24:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598513075; bh=21SE16AO2Es2A0sU9De9UcqocFt/7Hk8g8DosPEVjfY=; h=From:To:Subject:Date:In-Reply-To:References:List-ID:From; b=eLZxcVUDKDkCw3QeBIEWzquazVSvSqLr6PNmWsrOM1pOwUkIw5990GCwLaDP+zoZ9 Y1hbwiaogpgKyK9ssre0BLO3HbchIK79mieyR8t0BWEJjZqFxwr3FtGsXO6Mx9qksz 5AtIm0vdsAZabciLCo4iS8hAoECjv6/k15Ju77Io= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728145AbgH0HYe (ORCPT ); Thu, 27 Aug 2020 03:24:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:33190 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728079AbgH0HYe (ORCPT ); Thu, 27 Aug 2020 03:24:34 -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 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> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.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; }