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: 10064727 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 870FE60352 for ; Sat, 18 Nov 2017 10:56:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F3E52A6C6 for ; Sat, 18 Nov 2017 10:56:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 72CD42A7AE; 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 07BCE2A6C6 for ; Sat, 18 Nov 2017 10:56:12 +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=F3LKO2iqizWMC1gnaUuuNmT2udrSjPc1uPyuqebQ+T0=; b=thV sNRci8LImsBbdDV6jU8vLWWJIGOnj70eAHe0P2LCYhXvqr19HpB+E1aNb5Un/YnRjU5lK/q5JCU3N ergmwN9IuQrT2J+c88wvqe5QsQHl2RAzHfDTS8Lgdf7rMQWc7OrAKtwOyKqBSTUlGGvGTTlkc0PS+ u2VvzgEadmokxk345B1rCopwyAQve2/yBnYTxgPQAyEdCaRADXUqgAPCkLbJbJNObyYQNuISE7BD+ ynYwFvW9Pp5pachJWQp2rE4Bxt9pBkhL4oP2DKv3QlfJCcW5MTGhv6kVksvQem6RNjtFf4FcsC8Bx UdZTM8SrAW3gun7jArmJkdpGotXaDCQ==; 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 1eG0my-0005Wh-J1; Sat, 18 Nov 2017 10:55:56 +0000 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eG0mv-0005Vf-BF for linux-arm-kernel@lists.infradead.org; Sat, 18 Nov 2017 10:55:55 +0000 Received: by mail-pg0-x244.google.com with SMTP id c123so3829841pga.11 for ; 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=OkGthE5/Lmueb4k97J4coW8UHEKzZmVH8XYDXOU9IvhVQW2JGXDxff5I/drs3OKwc6 DJVtcVvf2qlB2iAfyjE0DQQ3mgk6XI9QEHmyx2k2zSEUG1oXV0ds4LSZliIIcRNayfpm Cf3r++qXYIqMJ1sMhsU2R5F/oRDTvVBkXpAvriosP5FPSOTUGZ0MaDA3nYwInhOTOLdm D6Rriu389xYij49L7rjqZ53nqh2o0L9lgVBlDCeHEI55iN8o7eNpJYZzrFdyTQkE9T+W eA+Y1GntZXmEFzqpAP7uo9pIEx8QAXH/NBoxwxJU3+1wwKQkS6Lmep4fN1jz97pBmwf9 9+tw== X-Gm-Message-State: AJaThX7oOPGeV+pjOGdWlgzORC+uMGyFW+lYKMaTJpxlDy1gb/GN9SrJ aY5/rgZ2n0DUAkFp43mzJiA= 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171118_025553_467614_6AB8CEB7 X-CRM114-Status: GOOD ( 11.01 ) 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 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; }