From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3133FC433E2 for ; Fri, 28 Aug 2020 14:59:17 +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 F28A020665 for ; Fri, 28 Aug 2020 14:59:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="fhlx0bUP"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="KCFZrlfd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F28A020665 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+linux-arm-kernel=archiver.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=Nr97aNSEPe2g8Hxv/mtTcpkdK9p84ULIFwZzwC5hLKE=; b=fhlx0bUPU+fknDKxI4FX+2A63R mEf1xWtSKL+Dump66JlY/7K6dfW1r5pFbt8zF/UaOGX5qq461Db/ULyT69uF1IgteqIfd4xPF2k9B Ek3YDZ5nY4V9WZaZbme56QENrm6/Xa3x5ydaM51EnvR+lUzjTYQzQZYcEuKhfsgedHiWpUcx0x7x0 5mfjox8hCrK48k/IyQW1eO0iEb5cCX/A1GcmHSkCmKYPeufcLEbDPEWDvfLrM3kZWzmTRXGo9DVjd TBXD1daJE8/i1yNwuiSORFgUQ2RLHGoF33C5OvDjhTGqn/HY8EV8++079+JgBCCsF6RWfY2yLx/H6 fSSaevRw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBfpM-0007T5-5Z; Fri, 28 Aug 2020 14:58:04 +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 1kBfpE-0007QR-CQ for linux-arm-kernel@lists.infradead.org; Fri, 28 Aug 2020 14:57:57 +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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200828_105756_486150_5772AB87 X-CRM114-Status: GOOD ( 14.88 ) 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.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 --- 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) { -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel