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; }