Received: by 10.223.164.202 with SMTP id h10csp2352588wrb; Sat, 18 Nov 2017 20:01:10 -0800 (PST) X-Google-Smtp-Source: AGs4zMaQVZl0f052OFxlQoCkU3sTpTp9KlhLJ0nTvS7a/6QcV0WgEVk+IvoI+FnNMAORKjh3/NY7 X-Received: by 10.99.119.134 with SMTP id s128mr9546331pgc.409.1511064070162; Sat, 18 Nov 2017 20:01:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511064070; cv=none; d=google.com; s=arc-20160816; b=I/ytLMoSPByrB9Ntf3q+0pafa7ROTvrfva/s3iQ7DuGWGgMhyFbEoBtE5HhyqzVtnL w+ESc82riH1OrBLnw8eSJJBAR5PdV6fqy1lvcTXligwXYTlejMIqMDNKCVb/egmCiMr+ 3j3oOdL1Qy3tlcQPGjK2sjTSn8fCynKWmBSQ/AaOaj/NJQS8YctAj7NXJVcPdo8tayC3 0MJUTkcjwv1yzLwDkNVEeFC6YZg43u6EkSMWCNlnbVBdfwzX8cQ6fRqBmF5dCVuSWB+G kqLUp7NLL5wz0wW3+cVTaUyMYopeTz1vHG9craPUDeNghZ9q8IMX7O70E1oYTh1ZQiKo ZaUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=wo4RVwk0WOYUao/9YgE9Xwa5k9ZhUjeO+R4/MLwMYkc=; b=j1hI4uwXwEQzKYAW5BCOTrFUj1RAzi44s71ugSzvsoHPC+VQV3mKXUu55sJv2AUGm0 gl1DqqbyU0Zq5NUgBcFOWBDRtDgwwvu5aSjDFY1oyPCrOFMp10vWkGN3Cs95kbX3QF+O NqBfwtLWEQr5kJTJyrABQKaGcX0OyQCPRlaPkaFdAdl1dp00GEGs6I45wSh/YccNeqJH H8OtUuABu0a96RFCbmnOe6RZjRbSJe1YEoPWegPm0HYq16hVNgjCg4g5PqUqJBg8KgYL 8MPyvNwpfgln6G4SULCVnNm2//a58pUsCQkfPvW8PHOjpYpjQNAhjzt/afL0f5xEyJtk SX+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MgA/4W0f; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l70si5310688pge.568.2017.11.18.20.00.57; Sat, 18 Nov 2017 20:01:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MgA/4W0f; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946710AbdKRK4C (ORCPT + 93 others); Sat, 18 Nov 2017 05:56:02 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:40614 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424059AbdKRKzk (ORCPT ); Sat, 18 Nov 2017 05:55:40 -0500 Received: by mail-pf0-f193.google.com with SMTP id u70so3826496pfa.7; Sat, 18 Nov 2017 02:55:40 -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 :in-reply-to:references; bh=wo4RVwk0WOYUao/9YgE9Xwa5k9ZhUjeO+R4/MLwMYkc=; b=MgA/4W0fa0zdqZH/2NSj7h/s2cjklUf2IMAy3KyvKYjuAf6Tq9OBPDRu8fL/wqeGQ4 +GjUwPI6FMRX+kZWKOdVKLvyZM2936mddBc/EoUZnsI4sqL9OY02hYFzM4AKXjRjjpbA WsLn0DLwGx8OPBHh+bDQHzZ61G80waoPGvqSV5mnoUpjBrayvJcV2SuPtu2yX6aODxlD tT0DgBOAnshY8kMmHijtaMYbMqXPsAqqC3HKeRzd1jzonWfCFoqWedu5h1ZPxUOoI4pC iszFr0h7VYbZgYRs2BP1fgcvkhUP32NYEEaBzmAahu4qQAmjnB2ZR+lJhZvlWLzYQNOI H8jg== 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:in-reply-to:references; bh=wo4RVwk0WOYUao/9YgE9Xwa5k9ZhUjeO+R4/MLwMYkc=; b=K1032KA/SNB+vXW/UIdps3Uhs2bQqs3+1UO0UaIC1ETaBiRb0TvaI22c3PitXjzpE0 7/3+9TjgZdZMeLaWvLDoYWw39E7wLymfsqUoPgPaqzvRyqpniA3OgiGpxOtOc7oE1dyB v6W/7b7bnDY/PNSN2faRJ9nexpTGcDMnIt90f6WeVFgv66K/iT1e9KXiQcxxFWI9eJGS DB/LS0RcvjBj2YUeVvV2q8oKX0w8jh+3cPhvqbYLzNLe6P7DdeyEp+VPWCxAqdjCYM8Z vAU8Y/oezU5joTFS3fTAb0ldFJpVn4BJjbHGcuLw3xiBflXXoxPGEP0zlyGspoLB9RP0 FbDQ== X-Gm-Message-State: AJaThX6RodJwmLdL8AQkNvYbcY/JJePRrbB3lHmcEkvUp0R+uIejkoFF +466kzR6i9/1s/gpjFtAaYk= X-Received: by 10.99.120.131 with SMTP id t125mr7841562pgc.81.1511002539889; Sat, 18 Nov 2017 02:55:39 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id g7sm12321513pfj.13.2017.11.18.02.55.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 02:55:39 -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 04/10 v3] Input: serio: Fix platform_get_irq's error checking Date: Sat, 18 Nov 2017 16:25:11 +0530 Message-Id: <8104ffc3b7bedee525c0cba9144cedaf04087fd4.1510999558.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 : irq is unsigned. used struct sun4i_ps2data int variable drvdata->irq. changes in v3 : Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid. drivers/input/serio/sun4i-ps2.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/input/serio/sun4i-ps2.c b/drivers/input/serio/sun4i-ps2.c index 04b96fe..38bb163 100644 --- a/drivers/input/serio/sun4i-ps2.c +++ b/drivers/input/serio/sun4i-ps2.c @@ -210,7 +210,6 @@ static int sun4i_ps2_probe(struct platform_device *pdev) struct sun4i_ps2data *drvdata; struct serio *serio; struct device *dev = &pdev->dev; - unsigned int irq; int error; drvdata = kzalloc(sizeof(struct sun4i_ps2data), GFP_KERNEL); @@ -263,14 +262,13 @@ static int sun4i_ps2_probe(struct platform_device *pdev) writel(0, drvdata->reg_base + PS2_REG_GCTL); /* Get IRQ for the device */ - irq = platform_get_irq(pdev, 0); - if (!irq) { + drvdata->irq = platform_get_irq(pdev, 0); + if (drvdata->irq <= 0) { dev_err(dev, "no IRQ found\n"); - error = -ENXIO; + error = drvdata->irq; goto err_disable_clk; } - drvdata->irq = irq; drvdata->serio = serio; drvdata->dev = dev; -- 2.7.4 From 1583479624661479759@xxx Wed Nov 08 06:50:48 +0000 2017 X-GM-THRID: 1583457460034654986 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread