From patchwork Sat Nov 18 10:55:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10064729 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0BB6F60352 for ; Sat, 18 Nov 2017 10:56:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 041C02A6C6 for ; Sat, 18 Nov 2017 10:56:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED0152A7AE; Sat, 18 Nov 2017 10:56:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B17E82A6C6 for ; Sat, 18 Nov 2017 10:56:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=4MubTYUGgOwKd+fEZdS0pcBglgepO6fN9I8V1KIbXRc=; b=UyAx55f+smqcigNhAZ0GCK2ARH dZ+rz+fYXMTH8YvV0JCBYms5Khd1X/Gcc/nCcVp0EbJ0XqdjOAqku+CtEU/ubWm0Jiw3v0vYBfMBE OYrsF9iXe5CzC4mHaWISDbRcplH44n2pTi2pELiZx/L5Xvjt2QnwATWNLsuphzB5xt7FFMsU/edos OMnQVSxgp0NWAM2OMvTurFkbPEBgkFbzfv66pMXI0Z2ZAavQq9wEDiaKkuCmd9NfsNuECF9jUCqt5 98QOGUkzAlLupfdez/VbAsK6AsCUikuCpGM0siA6OJXVngpnFNV4T58vFQ6R97S1l7agY55Y8wGbo 6EtGpZWg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eG0nE-0005li-Ug; Sat, 18 Nov 2017 10:56:12 +0000 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eG0mv-0005Vj-Bc for linux-arm-kernel@lists.infradead.org; Sat, 18 Nov 2017 10:55:55 +0000 Received: by mail-pf0-x244.google.com with SMTP id 17so3806770pfn.12 for ; Sat, 18 Nov 2017 02:55:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=J7RTNyBZghdVyWyOjffezbG4CAd0Qamg9+g/ktIiZrg=; b=ITcUMjpXJmno1eN+IDxVgwD/Zq2WNTY44w9V2GS6U8fwbNnXsDQt/hFRODR8ovNHB1 Q/xN7CENO4BDi8xZGhhWIBRxmnpqz/5fHLcqAN8OCmuvPYu3n2H8wFMGJEEKUvWJNlvC FTR5K1A4AwhaVJNd6JF2kXaw7TbuowSAYuBh4HaZsOlxcFcU8zXqS6woxaUyRqkz57LQ ikYI7kikQ4eRKc3SrZLzRBnO3TByDzmsTa1RW0jt/IqLSKtipkaQNCmbWw1OYgbkctYV m7elqo9u6vrzsD7jobzTLovSOAz+Y/siCaiQPTSvqkGu3E2hekntV+TTTvXZjdgy5w+j pzKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=J7RTNyBZghdVyWyOjffezbG4CAd0Qamg9+g/ktIiZrg=; b=VqY7p0tL2tcioSZnpPdwpXwlDmZpwrjtCBzFLqKnfBDISzyQs3vwsvFyFFNIjsTs9e vznnfMRTotkZf4aFf4aUyj62oECZDKY49NJy0f+he4+a/eNZhR716E68rSA+rERpwiBH qHskT9U9XSiXpCw9Cn3kipBQNrDDrnPAjgvNGbaqCe/sqhnX5QxR3FoPvhjcs8h5/JdU qJMYE/OPVjMJc+581WLpo4qdRSOKWnzsh/0ZJKV6lSWu00ip4Y8EG4nWm7pvVE5F0HQO sMBeeWsaImRixXVlHnzMLSxvg1EiNnLoQ/gDdne+/42VyHpGqowz2arIGOj5g0RNDz1k X6VA== X-Gm-Message-State: AJaThX47c6sHR97UYDLbq++TLqPiI11SDGZEGAw6jEKUcVtsAlqeaW7+ j8gHl48ooiu2zXNpYRh2gHU= X-Google-Smtp-Source: AGs4zMZjgdBT+7ymtriENFPO278QEKgVxDNeKn0OlI8p3q8894SIbhzczineDVcLCb7lLKUwtDKshQ== X-Received: by 10.99.55.30 with SMTP id e30mr7777226pga.156.1511002532777; Sat, 18 Nov 2017 02:55:32 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id g7sm12321513pfj.13.2017.11.18.02.55.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 02:55:32 -0800 (PST) From: Arvind Yadav To: dmitry.torokhov@gmail.com, maxime.ripard@free-electrons.com, wens@csie.org, mcuos.com@gmail.com, linux@roeck-us.net, linux@armlinux.org.uk, lee.jones@linaro.org Subject: [PATCH 02/10 v3] Input: omap4-keypad: Fix platform_get_irq's error checking Date: Sat, 18 Nov 2017 16:25:09 +0530 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171118_025553_477828_E21EBB9B X-CRM114-Status: GOOD ( 11.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-input@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The platform_get_irq() function returns negative if an error occurs. zero or positive number on success. platform_get_irq() error checking for zero is not correct. Signed-off-by: Arvind Yadav --- changes in v2: Return irq insted of -EINVAL. changes in v3 : Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid. drivers/input/keyboard/omap4-keypad.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c index 940d38b..9ad840c 100644 --- a/drivers/input/keyboard/omap4-keypad.c +++ b/drivers/input/keyboard/omap4-keypad.c @@ -251,9 +251,9 @@ static int omap4_keypad_probe(struct platform_device *pdev) } irq = platform_get_irq(pdev, 0); - if (!irq) { + if (irq <= 0) { dev_err(&pdev->dev, "no keyboard irq assigned\n"); - return -EINVAL; + return irq; } keypad_data = kzalloc(sizeof(struct omap4_keypad), GFP_KERNEL);