From patchwork Mon Nov 20 16:26:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10066749 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 8734460375 for ; Mon, 20 Nov 2017 16:26:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 755D629170 for ; Mon, 20 Nov 2017 16:26:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 66D7F2922B; Mon, 20 Nov 2017 16:26: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 613B629170 for ; Mon, 20 Nov 2017 16:26:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751537AbdKTQ0n (ORCPT ); Mon, 20 Nov 2017 11:26:43 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:36890 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751518AbdKTQ0m (ORCPT ); Mon, 20 Nov 2017 11:26:42 -0500 Received: by mail-pg0-f65.google.com with SMTP id o7so7747979pgc.4; Mon, 20 Nov 2017 08:26:42 -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=jl0GjPeeLqyDSbPDhVNLljjqtlqFjqVlQj4mE2hFQOE=; b=ZHv4IyVLiCEibiMDTP3MQ9BclbWR5KvjVjsgReQNaGlFxFrhQgoc2k1YAy46p+kDJx AMUvUOt2kqtBrpaEeYMK9aa/Uncm3RDPa9rpLb2SqbDe9FaxK2PIyjCIm6rv7NZRhK0H heGgCpfj3fIfCpNrocsCYi3dwv8e+/PChLF/Dnylq+DWKEfSm8hKCZrmQ0dQa1HZ+wHz Yg9qWxTtI+HMt3GfFX5SJbi3/RZvnUPDFfzbshZrpwX287bRzzCqK5XWnlHgBIck2Pd+ iv35/96gw/VqmMCPjJg7SSbCbtgWRP9JlgbITuHXuWv/Yj6VE+BmUQpOJmipcN/8CffP iKlQ== 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=jl0GjPeeLqyDSbPDhVNLljjqtlqFjqVlQj4mE2hFQOE=; b=N6Pg3o5IVhnzvcJe7uloagwQdxr1YFRsmAMoSBHZGWd2fQJnbqpeIrN77bK/+V/z9z 9jXEZXQ42BxqjYMMLDMzGBN1ZhsLWCWS5Ro6mCQHdf2Rcds1VVBGzb2R/gvUdsgngiI7 o0Ki8mDoIfZwHQEbY8OIzXhP89MB0CjGpVJmbmKqbN33Vdd/x8nhbCr4oYr2px3+9vC/ mDh586LbPb+rV6vkTRWlptMbp+iweedkIaVlEmXC7WmIMaDpKnGlTZ5AZ4lvL6IpAbf3 R/z0oKGcFZApxbI9hKrgIypcluespaXe3pqfZs74jO8XaSZ6cxmH3lCDgcULUW3tajvo OEZA== X-Gm-Message-State: AJaThX7xYFG1t32b/q4xFn+7c1bUNwjgTYl9TxL8VAvURYs/xWAc9RNS rTO+KjKJE/AFHCPmKpeGt78= X-Google-Smtp-Source: AGs4zMbMfhynwSFbwELvazXBCoNQBa0PxGAJh72x5Nj6whVk3H8fgr/mktIIjDBT0VIhtSQB2HODyg== X-Received: by 10.101.71.205 with SMTP id f13mr14166850pgs.112.1511195202172; Mon, 20 Nov 2017 08:26:42 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id r68sm20534975pfb.149.2017.11.20.08.26.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 Nov 2017 08:26:41 -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 v4] Input: ep93xx_keypad: Fix platform_get_irq's error checking Date: Mon, 20 Nov 2017 21:56:21 +0530 Message-Id: <987ac156e9590cbe2f667f9782b56515d7a991a4.1511194239.git.arvind.yadav.cs@gmail.com> 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. changes ib v4 : Return -ENXIO insted of keypad->irq. Which was not correct in v3. drivers/input/keyboard/ep93xx_keypad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c index f77b295..c6eb31a 100644 --- a/drivers/input/keyboard/ep93xx_keypad.c +++ b/drivers/input/keyboard/ep93xx_keypad.c @@ -257,7 +257,7 @@ static int ep93xx_keypad_probe(struct platform_device *pdev) } keypad->irq = platform_get_irq(pdev, 0); - if (!keypad->irq) { + if (keypad->irq <= 0) { err = -ENXIO; goto failed_free; }