From patchwork Fri Aug 28 14:57:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11743109 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 2C15314E5 for ; Fri, 28 Aug 2020 14:57:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 125B4208CA for ; Fri, 28 Aug 2020 14:57:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598626676; bh=KYG3iaeJzQP1RJ6YodGmBJnOc9QTOtwrvTEilsPrB1g=; h=From:To:Subject:Date:List-ID:From; b=OF+1XZ4hFpHMnxB1Zt3CNyJ8B8MQBueF4SP397eO6N83UY8pklKW2zVLP+1mCU4rp tJFyvrI2vYSucVGCZBPPZPuFaHTT0hrqq04NzIRFdWHjqj6YXF1Ii26uOhqc8B173k TXpe0AdgLfgXtowo9HU4JgZN2kt0qit+Rf5J5rgU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726400AbgH1O5z (ORCPT ); Fri, 28 Aug 2020 10:57:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:54632 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726322AbgH1O5x (ORCPT ); Fri, 28 Aug 2020 10:57: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 D921320665; Fri, 28 Aug 2020 14:57:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598626673; bh=KYG3iaeJzQP1RJ6YodGmBJnOc9QTOtwrvTEilsPrB1g=; h=From:To:Subject:Date:From; b=PeeEPWhmB2qE/0PFrPQ33ve/EDVABitCyqACXjRUNYzaYYBHxWbl3wFbHllwD3X26 QZCnS5RCSjk8XNW5H3bgGDKA0rjjHzG4BapDKkcVR62sKRCy2+DIJUR80FJtxE/h1Y KREqg/JVIcScMshYurIOJjYEgz+eqMRZxldiRI60= From: Krzysztof Kozlowski To: Dmitry Torokhov , Maxime Ripard , Chen-Yu Tsai , Krzysztof Kozlowski , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 1/4] Input: ep93xx_keypad - Fix handling of platform_get_irq() error Date: Fri, 28 Aug 2020 16:57:41 +0200 Message-Id: <20200828145744.3636-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 --- Changes since v1: 1. None --- 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 Fri Aug 28 14:57:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11743111 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 CC3E4739 for ; Fri, 28 Aug 2020 14:58:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A9BA6208D5 for ; Fri, 28 Aug 2020 14:58:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598626686; bh=LsVu0rhAEPs3Kam00nbZ5Bzs8RCeve3QgJZPD8qDTQo=; h=From:To:Subject:Date:In-Reply-To:References:List-ID:From; b=GCN4hvZa4JShDl3tc08SZCKYwHCVF2J3/2x5hHQygOtLLsJ7EjZvOqN7duwYs3Ywn M8faQMB2oAmqUeptgTPwCQ9wSCOlNwHtjn1rydOTMjCl+G9CmzyDEmOwsZw4o3raq7 s9a8Kkeq8xaHN7rFShHgXVQMMRXfsfji8Q9MB4uo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728062AbgH1O56 (ORCPT ); Fri, 28 Aug 2020 10:57:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:54644 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726322AbgH1O54 (ORCPT ); Fri, 28 Aug 2020 10:57:56 -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 221BC20848; Fri, 28 Aug 2020 14:57:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598626675; bh=LsVu0rhAEPs3Kam00nbZ5Bzs8RCeve3QgJZPD8qDTQo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=KCFZrlfduBuK2CPrFr9mjtzD5Vuj4OHVc4PP/ml/hbrFyqwLqu406kwjBv6cQaBY3 OcForBG1hc/qCilHNA1lyjhsNa5PihGb+swuxvbFtN+vH/+goOYJR73eJT1TpmqRnQ irE4/lSf2kaEpEQfMU6f2OB4j3Q6aJmzHo21e8o0= From: Krzysztof Kozlowski To: Dmitry Torokhov , Maxime Ripard , Chen-Yu Tsai , Krzysztof Kozlowski , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 2/4] Input: omap4-keypad - Fix handling of platform_get_irq() error Date: Fri, 28 Aug 2020 16:57:42 +0200 Message-Id: <20200828145744.3636-2-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200828145744.3636-1-krzk@kernel.org> References: <20200828145744.3636-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 --- Changes since v1: 1. None --- 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 Fri Aug 28 14:57: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: 11743117 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 D06BB739 for ; Fri, 28 Aug 2020 14:58:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B1BD120848 for ; Fri, 28 Aug 2020 14:58:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598626695; bh=K1SfNqgOjhaw0jo9vFZ10HD935ePRAU+4AWSGMFavXQ=; h=From:To:Subject:Date:In-Reply-To:References:List-ID:From; b=vlXbUM7AcBsUfw3fZOuRCwEKyQMkc8NuB2jDvDRh41JTt9m5fGml3iM7gnW5VhMx2 6jGCcPPxMNCHK8aO5vLvzbjvNDZeTXMrOB/mwnf4J5NClCPkRQ2VkOhgpNRmPH1yxF PnqYUO+Tr/57fCYyP3X0iIbTtc4+oSdXmKQ5TjZQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727017AbgH1O6F (ORCPT ); Fri, 28 Aug 2020 10:58:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:54708 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728058AbgH1O56 (ORCPT ); Fri, 28 Aug 2020 10:57:58 -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 44439208D5; Fri, 28 Aug 2020 14:57:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598626678; bh=K1SfNqgOjhaw0jo9vFZ10HD935ePRAU+4AWSGMFavXQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=u7mGWyBCv53nhsm+ewFH0Lek8v+LUMMY+RBpKUPflKcoShjuwHKnMnqHkLN+eTXdo DFttvg8e7bKPHfPMgrdlerNS1LS+HNU/i5fSQZ0zprWSVR0bZ8o8UBJi3FK8xt1Ija Ya6drbvzheQtP2bzUtCiRjxhUCTKj9M4NTh/kErQ= From: Krzysztof Kozlowski To: Dmitry Torokhov , Maxime Ripard , Chen-Yu Tsai , Krzysztof Kozlowski , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 3/4] Input: twl4030_keypad - Fix handling of platform_get_irq() error Date: Fri, 28 Aug 2020 16:57:43 +0200 Message-Id: <20200828145744.3636-3-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200828145744.3636-1-krzk@kernel.org> References: <20200828145744.3636-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 casting to unsigned and comparing to 0 would pass the check. Fixes: 7abf38d6d13c ("Input: twl4030-keypad - add device tree support") Reported-by: kernel test robot Signed-off-by: Krzysztof Kozlowski --- Changes since v1: 1. Fix also casting return value to unsigned. --- drivers/input/keyboard/twl4030_keypad.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/input/keyboard/twl4030_keypad.c b/drivers/input/keyboard/twl4030_keypad.c index af3a6824f1a4..77e0743a3cf8 100644 --- a/drivers/input/keyboard/twl4030_keypad.c +++ b/drivers/input/keyboard/twl4030_keypad.c @@ -50,7 +50,7 @@ struct twl4030_keypad { bool autorepeat; unsigned int n_rows; unsigned int n_cols; - unsigned int irq; + int irq; struct device *dbg_dev; struct input_dev *input; @@ -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 Fri Aug 28 14:57: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: 11743113 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 3FEB4739 for ; Fri, 28 Aug 2020 14:58:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1C1C5208C9 for ; Fri, 28 Aug 2020 14:58:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598626688; bh=6NKW0SsZH2UMJHW1u6L7PG/Ylu2jZT2JA43D3ueOJY0=; h=From:To:Subject:Date:In-Reply-To:References:List-ID:From; b=ojpM/He4NtwPTFYf7upccNVQuDazTnwoDy/YEuJnQak7IbB7GZMACbysm6fNBIkxQ +m862FQvYsKOoAbSUKvZ8dU4g4ul+d68NRLuHRPCHyTgHC809mtcrURgUjNkDfZOrl lJpDwbFbVq9wbINpBQ1p6C8ygiLodu7xk6VNLWKc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728103AbgH1O6G (ORCPT ); Fri, 28 Aug 2020 10:58:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:54722 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728082AbgH1O6A (ORCPT ); Fri, 28 Aug 2020 10:58: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 83BFB2098B; Fri, 28 Aug 2020 14:57:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598626680; bh=6NKW0SsZH2UMJHW1u6L7PG/Ylu2jZT2JA43D3ueOJY0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=pV57CXXRRHTllUKPQ9Jt4z/qOLctkn9Zg/hsjM/bJMiR9d6XtfIF7yWKWp7nc2MBh N32z5EUXHCBRTgoj8s9u9s/McpKwWJZiEWkzyvBPSjnpVtGd1ATnOd02d+HjfFlFMF b2i4/WLFQdcWIJ9238uorm1EgL1CbgRXQEzNtNjY= From: Krzysztof Kozlowski To: Dmitry Torokhov , Maxime Ripard , Chen-Yu Tsai , Krzysztof Kozlowski , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 4/4] Input: sun4i-ps2 - Fix handling of platform_get_irq() error Date: Fri, 28 Aug 2020 16:57:44 +0200 Message-Id: <20200828145744.3636-4-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200828145744.3636-1-krzk@kernel.org> References: <20200828145744.3636-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 Acked-by: Chen-Yu Tsai --- Changes since v1: 1. None --- 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; }