From patchwork Sat Nov 18 10:55:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10064721 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 B61B960352 for ; Sat, 18 Nov 2017 10:55:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A467C2A683 for ; Sat, 18 Nov 2017 10:55:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 997862A7BA; Sat, 18 Nov 2017 10:55:45 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D95F2A683 for ; Sat, 18 Nov 2017 10:55:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422790AbdKRKza (ORCPT ); Sat, 18 Nov 2017 05:55:30 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:43865 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422776AbdKRKz3 (ORCPT ); Sat, 18 Nov 2017 05:55:29 -0500 Received: by mail-pg0-f68.google.com with SMTP id r12so3834523pgu.10; Sat, 18 Nov 2017 02:55:29 -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=L4Y1mh5hm93zkNk7euE3sw6P5LznSgBX17hY+3fEni4=; b=pCsdC+46/wi0GwvMDYKT9FcCmERWy7pFhhB342il0VvGvsFXUxXQy4Fgkf5gfGKwur PHwoSpjc22KQQbkLqdWXTegZ+wdkfyc7rBqZ2juDvmc89vA2sStmt7FTil4bv3Wz+Xdr ZAjtYrHme1jw4NOje2qF40sZIc1RuHKeOCKLVvTDkBK/kAa55QO+mstheif+dYRJeiFe Z2ht1uXbBdQx8dxuhEuIxO5aF8Y1cF02kaovAjuaRiXdBoh77ia8TO0s2f7qoelpq7BU /+CNSA/KkzF4SfkRHIdslPWfLIIS8Vz/Lbh1yyC9o1zSjFYSDVC++bxAfHFuHP5FKTbw 2y1w== 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=L4Y1mh5hm93zkNk7euE3sw6P5LznSgBX17hY+3fEni4=; b=QR3YaxG0Rcnaki3nfrWO1tG/meXLA1dsKWslpRYeBFe3Hl2IouexY3fDfrxxK4aIhN VcsfXPzEmh1cKgiXgnTH8WkIzx6mn5ic0xu85otnUDe1Iq4bwe0zdd8MbfBBqQ702iPn SwXFaQ7CobQmYjwuYPaIGDvMfWbqdpiAnlkFny/pRzEhmIf6YOv7N1cBho+Mbk+a87DA NUS2Vx2QNbQZs7tjRWDBTr33bAJEoXOxyRbi+Wqkur4abns7TflxLtcmHObm7/+WP3NF UzfFCWyLWuvmcE4xrm5IXGrSU6kI7/nX5zbN/ks33Y3Ag9FAO+ZzH+8704pTk+MsB3I0 cjQg== X-Gm-Message-State: AJaThX7mNJhdnBNZVo7M2X9+hqsRed3hd38REpE7SRf+/NGwdPb886hA 4+MaNtLjtDgO/KeGCc+Hj1o= X-Google-Smtp-Source: AGs4zMYynUBaBXQcRCcLLI7fl8RjkMDZAAOUv2h9WOK5t1o/MUzSr4bShMk3TjMuDBuB5/S0PMsNlQ== X-Received: by 10.159.197.67 with SMTP id d3mr8064866plo.409.1511002529368; Sat, 18 Nov 2017 02:55:29 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id g7sm12321513pfj.13.2017.11.18.02.55.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 02:55:27 -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 Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 01/10 v3] Input: ep93xx_keypad: Fix platform_get_irq's error checking Date: Sat, 18 Nov 2017 16:25:08 +0530 Message-Id: X-Mailer: git-send-email 2.7.4 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.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 keypad->irq insted of -ENXIO. changes in v3 : Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid. 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 f77b295..01788a7 100644 --- a/drivers/input/keyboard/ep93xx_keypad.c +++ b/drivers/input/keyboard/ep93xx_keypad.c @@ -257,8 +257,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; }