From patchwork Fri Nov 17 20:20:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10063661 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 BB556601D3 for ; Fri, 17 Nov 2017 20:24:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD05F2ADA0 for ; Fri, 17 Nov 2017 20:24:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A159C2ADA7; Fri, 17 Nov 2017 20:24:04 +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 3F6FC2ADA0 for ; Fri, 17 Nov 2017 20:24:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161777AbdKQUUW (ORCPT ); Fri, 17 Nov 2017 15:20:22 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:34111 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161765AbdKQUUP (ORCPT ); Fri, 17 Nov 2017 15:20:15 -0500 Received: by mail-pg0-f68.google.com with SMTP id 4so2736438pge.1; Fri, 17 Nov 2017 12:20:15 -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=HJPjcLNxExWQPbIU2n8QqxCEKnT+d2Ym6b8x9TrWrl0=; b=UFycR/Sr6bad0prdAUjL9soxMAfe6lIUVSkLTmQIE5iWy9WBdUBhgBEPcBa4+0rWll j9ER7s5ERv7AVxbOIvO0FJlBJLzpvcWZROuYhv4R0Vs3XqCHwn/yvESSoVVQ8NLG7YU8 fYQdHA0lnF9fIeazE7UyIiezu81tbL1kgDIAul9Hod6+IXy4OyFauUnETgguXUC4Tk2S GacSsCYP/ylALlH025co+RhMlreAzCeu7PciVHckbMBcGdeT3Dq758Ye6gwBKsyAmCNQ idJgQRrvB7q1R+rGiWs+R4aACs1oQQvhitAD9eb+OzssvQ1ZADhvuS+1y2ctchtT1Fh7 gcgg== 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=HJPjcLNxExWQPbIU2n8QqxCEKnT+d2Ym6b8x9TrWrl0=; b=cJbLjE2leA5gOrD7cEEX+jQifxjXfS/c6PEjRucaXuNA0QMZbGJalgcyaiAjB6iFsJ rljpWiAeJnt/DCU4CKRJ9XDtAF7sfhVJn0wXe/ZnyCAtzrdtaOumTiWAlnsqFA4yu6eq BBiBYD3hmZeP8C3d8pQ2RjqZGClIQKSX2Kcq/MBQ32bkmbVn47fRYmGdWwBp64F/LCBL dknz7RIiqE6IAafiNuagl7dQ50GzFW5RMsIK0Jb3tvqy0zCZEwNwYewCcmboK/5lM+np NoAQ6UaZ83npKUuzrFJA+E98EkRPyX3YP9GJ3k9w7PNve86O+cQdoOSpZFtIQ260uQaQ jI0Q== X-Gm-Message-State: AJaThX7QWKt2vD7URlCqGYW5zcfG/1uc5vXTixVjJLtSY3k+2etZppm0 95OzQv3xd52hzkW1OF4cFqE= X-Google-Smtp-Source: AGs4zMYI3JGbqUZH7SR2DgNQ1JrvaUtueS/tv17ghAuEekW9tyqtXdFacfoRvBJJ7+lup6IV9grH0g== X-Received: by 10.99.122.73 with SMTP id j9mr6160920pgn.154.1510950015256; Fri, 17 Nov 2017 12:20:15 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id i3sm7674715pgc.88.2017.11.17.12.20.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Nov 2017 12:20:13 -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 Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/10 v2] Input: ep93xx_keypad: Fix platform_get_irq's error checking Date: Sat, 18 Nov 2017 01:50:01 +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 v2c: 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; }