From patchwork Tue Nov 21 16:11:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10068577 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 3EC696022E for ; Tue, 21 Nov 2017 16:12:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30D1B29803 for ; Tue, 21 Nov 2017 16:12:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 258BF2980D; Tue, 21 Nov 2017 16:12:30 +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 80BC42980F for ; Tue, 21 Nov 2017 16:12:29 +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=I4j92TOxk/t/NNvwrvNCulyUNwut55zjL2vAO0vPjk8=; b=pgP 5dFrOXNDU9cHhNb0C1aIAQntVOY2q8xa2TDP2Abo65FgWl0MP4rHvZd0FAVpDmHvILMj/Suy5cvbf 0SVnDv2LiXVM7F6gOsGMfvmGrOifnyxUIQqv/EA450wq4WUO32kf4Yjlg1kx+Ldnk4ay7AuYbPSlD kwiQwwFeVOsOOvV6JUB0TfcnEdTfp118ny/I2L/3ITxDoHZAGoldi/6TeGR80y8N4kfzKE1JwRCSv 5Uw51RAI/mnvno6BmcDIuVXY1glfzwWzuk20qbn512b63RVodnElRNNqsadE3vWgMyXuYtm1UyVbP 3w6y/+PFrPgobviLYzD2+qKpDWfWTRA==; 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 1eHB9u-0001J6-6A; Tue, 21 Nov 2017 16:12:26 +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 1eHB9n-0001Av-Ke for linux-arm-kernel@lists.infradead.org; Tue, 21 Nov 2017 16:12:24 +0000 Received: by mail-pg0-x244.google.com with SMTP id s11so10508848pgc.5 for ; Tue, 21 Nov 2017 08:12:03 -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=IFxAv1TlyoBReSIkK/v46oszVTskKTfPYTtZdjE1U+E=; b=fUoMVaYVA0BCK6dTDoHKIv7JJMtQJBy6oXqIthY6CajoO8ZBrDG0n3O+S+mM/lIMO3 Mj/Mz7DqYxtSRjLfOnat1HHr60fnH0Sn6T0Iqf1zrZ22aQTK6KXqLHZRaiHo1q8zg+f7 MT6QZYlY9cqY0+/8NJrlZJIyd5KNbqtMR/hAU+GQvaV9TitjtiDlg783pv7BVYT+NNaO GFtLArVgPN1VbfCUrseA/XGgsW4QqmbO1SSRAuHLvOAKnllzU7Sf5f2KkgFqP28QdAEF fB5Zwbt6W/r4bHCBBW4wUbtTzQ+GtLHHImR4BnWiI6bXkHaALPmc6607UYyl3vY/6mtF tHMw== 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=IFxAv1TlyoBReSIkK/v46oszVTskKTfPYTtZdjE1U+E=; b=Fz7Db7tI9pMDWo8BOLnGtaFW0zOBUm7Kh8jbXqKsDM/7yqFCq2wsND7Yafs3M1chn6 eswgw1DUHmUDCRepv0Csyj5IB/o8VrPQVG6tBGnxIMZ8GILdLcKd1qjZImok5fZXZRoU Jzp0V6Gq28i8OKyaSDO1RRs4qr3noMv3FOFti0Xm3uzPg1FlceTafD9pTCkT3m0gjtmH 23p0dKmVSB4xwDn4smOHuXGzO7vjaxo+eZfKP9tIDFfmqrTjTiB85OsOJGoRA2ACEHTU RZyzjKz7H+tTlGotv386G4MTJN9axsesAebyPHVLdfHqXeXCCmY2pw7FbdVtW0vQgmyA jY8A== X-Gm-Message-State: AJaThX6ixecV6qAgxXnp2pjHenTryP+sToKHNnxp+Rb+H20ctx/npLlT 4KrqyK4KqCCUBAFYFcRcpUU= X-Google-Smtp-Source: AGs4zMaSbx8I1ebQI0l04S1+PSLDH56spArN+2D3hq6RR+E9ZAOnR+IF/PF7CkTVw/HTBLswnLWkPw== X-Received: by 10.98.10.143 with SMTP id 15mr15556277pfk.89.1511280722807; Tue, 21 Nov 2017 08:12:02 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id h192sm9764931pfc.139.2017.11.21.08.11.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Nov 2017 08:12:01 -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 v5] Input: ep93xx_keypad: Fix platform_get_irq's error checking Date: Tue, 21 Nov 2017 21:41:51 +0530 Message-Id: <49ba0386f1930f58edfd5ee0f5e65d2a02a46744.1511280261.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171121_081219_746774_ED7DB88A X-CRM114-Status: GOOD ( 11.81 ) 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. changes in v4 : Return -ENXIO insted of keypad->irq. Which was not correct in v3. changes in v5 : Remove changes of v3 and v4. go back to version v2. Which is correct. No need to check for IRQ0 and return keypad->irq insted of -ENXIO. 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; }