From patchwork Fri Nov 17 20:58:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10063949 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 1C1736037E for ; Fri, 17 Nov 2017 20:59:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0F27B2ADE9 for ; Fri, 17 Nov 2017 20:59:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 023582ADEE; Fri, 17 Nov 2017 20:59:47 +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 F0E0B2ADE9 for ; Fri, 17 Nov 2017 20:59:46 +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: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:In-Reply-To: References:List-Owner; bh=5iIeErucsz5YhxOdxoejV6HeEBTQe96qsHpcaqnzPEI=; b=JE/ BW6ksISLlI608VkCcIZo0/jAy2XofPP1suy47N7b5Y0Y4ZrUlpbczTxqOOZjc9A8YSOpc2t06LEEC LESMKyuhwtFpqHedn/Z1BwbVmMnoP/C2J6qy/nEoaW8r7bch+OniAApWfdEotM7jsyGrTyJadobRl R/AjOrCNDei0hhgXLiVtLPgc2tev5MIx6eph0r9B0F9hjMwMYG7DMeZEittUIFj/57dDL4iivdxyB bB8OSdwU2e/8kmdYp3E7o0FgNBUbIHQru9PeWExn1tW+HZu84AFQKLk5W4Qh8Fu7lXay8MsAE9Pkf AOjU5MmnSqZGxnXlEemnOnmsAWELilg==; 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 1eFnjl-00075c-Ox; Fri, 17 Nov 2017 20:59:45 +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 1eFnji-00074S-GX for linux-arm-kernel@lists.infradead.org; Fri, 17 Nov 2017 20:59:44 +0000 Received: by mail-pf0-x244.google.com with SMTP id m88so2762696pfi.9 for ; Fri, 17 Nov 2017 12:59:22 -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; bh=vq1JUvfDngXy8VcS65jJ0cHMZDNCOJBn9KQ71rwcE6U=; b=UKkkZjakVPGr74T1K0d/aAB5/YMc2U6TeyW07xHTg8zELHWLhnUFuhwpmJql7b/rNo LMqtIA9caVVtA1JKiy6CzGLwABPdwhdT2zcFYaVgXYEPMfjRMWOQZnLL+DwOwp3Arel9 NtdcAZF2n5s8KFgFv1EIQ/POZBc8rWN7u0KAQFDL6lbY5JyZmlAnrg4zXxa5Ku0x7gCi JeQpHfY1FAH5uiouvp8CK39rC4Zu3gcoO3yV9omckpqxmPtwRCYwdGihjbkAGokSlrhG iaTZhvQZGid6mZrudJPSYnW+e3MweORFq36QZDXFzSH/QMFV5KCwOxxGvONv7nG7Kjgr gDrQ== 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; bh=vq1JUvfDngXy8VcS65jJ0cHMZDNCOJBn9KQ71rwcE6U=; b=uCzG+KiWRfWaatrkLrsnuteBzS1HjWZK9KIrvsCaDCd9IrDMwfAECGSXDRKaVenbQ5 eXRCjoQg54Z/hCIpql1gaFI2aie9AO+ITgMVBnXmnNGFcjPy6F2axyBqjk+lPR1RR5+W s/v7OFgV6pcpMEJXnUxToMNvfSjf0Z5QgX8fXb1WwLUJ9V2MGp0Wt0TNDJldhptXCdyJ 7/PcU4gMN6qw50HJqH/zNtiJ3vRV7Vmx9Q1geISw6K+nm7iD+hxpcHl50GunL8VspIXx oQGt1gTG3ddOditCOAUB9s54/dmWvZR9T7xFfCE4lFBohOS9X6NQqgpeGqbTqao+yyt4 dcng== X-Gm-Message-State: AJaThX6S4tN6CNJCPA9NyO521YQIX2EN/Uos+hdt4ABoHAsGNwK63Tpf REpHy2reGVahsfhddZN8PFA= X-Google-Smtp-Source: AGs4zMZGxMnfn3ZH8alF2eV6XkqlUvIcG613GvgQMXcBasa3xXC5hL3XC3XszK9V7xDY2mgcMBiZ6Q== X-Received: by 10.99.123.90 with SMTP id k26mr6300859pgn.33.1510952361708; Fri, 17 Nov 2017 12:59:21 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id f12sm7650857pga.7.2017.11.17.12.59.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Nov 2017 12:59:20 -0800 (PST) From: Arvind Yadav To: dmitry.torokhov@gmail.com, maxime.ripard@free-electrons.com, wens@csie.org, linux@roeck-us.net, wsa@the-dreams.de, daniel.thompson@linaro.org, mcuos.com@gmail.com Subject: [PATCH 1/3 v2] Input: omap4-keypad: Fix platform_get_irq's error checking Date: Sat, 18 Nov 2017 02:28:48 +0530 Message-Id: X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171117_125942_590128_1F9C745E X-CRM114-Status: GOOD ( 10.93 ) 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 ib v2 : Return error(irq) insted of -EINVAL. 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);