From patchwork Fri Nov 17 19:15:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arvind Yadav X-Patchwork-Id: 10063421 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 3D1686023A for ; Fri, 17 Nov 2017 19:16:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E1992ADA6 for ; Fri, 17 Nov 2017 19:16:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C8802ADAA; Fri, 17 Nov 2017 19:16:23 +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 A438F2ADA9 for ; Fri, 17 Nov 2017 19:16:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935583AbdKQTQT (ORCPT ); Fri, 17 Nov 2017 14:16:19 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:42102 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935515AbdKQTQK (ORCPT ); Fri, 17 Nov 2017 14:16:10 -0500 Received: by mail-pf0-f196.google.com with SMTP id m88so2589062pfi.9; Fri, 17 Nov 2017 11:16:10 -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:in-reply-to:references; bh=X3BAAw9srmxN1NUdc/b+xMgmUdwI2x8WciWKZlxZz2w=; b=YIRA5D2DmquLqf7A+EVWsCf1De5cCfNya5HnIjrplJInvdSG3gZlG3Swvc61AswEqY xhM88g2qkjZHdW+gF80dHDd3YZoziYZNx2MZo6PrcBmr52F1fMoEjc5g3cSwnv+NCMYV 7xMJ8lFCgbujIsm28rE605oushwMLQQkLrbB0xbyLoWsYlHrgFRZUea7uVdwzR/aT45C vUIPxVMPh2VKaKXq1OZy+7QPPFaoik+GXNsZT1vBcC3deiBfM60wFgjwXKDRvaz5m/Xy 4Jimvmd/n6/birztjPTp3woWLhebU0aIik9l/hFdRoZ3X25795J/owXvowLmXPm5jCit Q6bw== 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:in-reply-to :references; bh=X3BAAw9srmxN1NUdc/b+xMgmUdwI2x8WciWKZlxZz2w=; b=EVm9gCyhAculoKQoONtmcv04IYOXjvjfk1tDRC2Gjea3pPsFao7SHP4lP+Dkvt9Wo/ vs0QcC0A7JSZWR11bPJUnrPakT26NEwOZTsxjwAlN7nNFSXmwsws98tRLd2PjE4Kg0so zvX8m6iiryqByrVIAVq09n+25qDkNJPijGnN/X/dZeFSQ+yDmDl+ULPUOeeNJ61ll5iI ACCgkkRH95j+x9kSHIuXFqFU0Bf/xN6gXVgU7R4iIgBozmF3mokWvSmLC9P4TTZ8mj5G B2OHImk498rzQR+z7XLkVp6A3LISkPYtdChqnh2WNa3zusos5GP8ZBXruje4poNYjXjq namw== X-Gm-Message-State: AJaThX7xDjszeJGMFfg4icU3hkPLYlQC9I+PRE4g3xnMpxnPIiAylTHr luD17y9LetQpvpp2Y+eG4uE= X-Google-Smtp-Source: AGs4zMZUCYe3/lapHk12bBzm0MTOFTEh1K7yLcVIE2ayEjf1tW15g8qLo0nDj8Ta3C60hjze3RuFQw== X-Received: by 10.98.34.199 with SMTP id p68mr3041732pfj.241.1510946169784; Fri, 17 Nov 2017 11:16:09 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id u188sm7807441pfb.188.2017.11.17.11.16.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Nov 2017 11:16:09 -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 04/10] Input: serio: Fix platform_get_irq's error checking Date: Sat, 18 Nov 2017 00:45:26 +0530 Message-Id: <1510946132-13554-5-git-send-email-arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510946132-13554-1-git-send-email-arvind.yadav.cs@gmail.com> References: <1510946132-13554-1-git-send-email-arvind.yadav.cs@gmail.com> 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 --- drivers/input/serio/sun4i-ps2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/serio/sun4i-ps2.c b/drivers/input/serio/sun4i-ps2.c index 04b96fe..405c82f 100644 --- a/drivers/input/serio/sun4i-ps2.c +++ b/drivers/input/serio/sun4i-ps2.c @@ -264,7 +264,7 @@ static int sun4i_ps2_probe(struct platform_device *pdev) /* Get IRQ for the device */ irq = platform_get_irq(pdev, 0); - if (!irq) { + if (irq < 0) { dev_err(dev, "no IRQ found\n"); error = -ENXIO; goto err_disable_clk;