Received: by 10.223.164.202 with SMTP id h10csp1538318wrb; Sat, 18 Nov 2017 00:49:09 -0800 (PST) X-Google-Smtp-Source: AGs4zMbtMScO+qHBgjtHxYCS9aje2T2sWhR2DgBVHtb28Cow0JMvE+nnDpfqz2zonkCWWNYPftol X-Received: by 10.99.172.88 with SMTP id z24mr7757326pgn.46.1510994948889; Sat, 18 Nov 2017 00:49:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510994948; cv=none; d=google.com; s=arc-20160816; b=EXPD3w6T6E9Bfsw+lY5CA7pvuPP0E1v/SCntorTKwA3xmkvD4buaUpjpnuzV/rKn+l x6OrTkTKtpRsiX/522xfx7z4rqsvpd7fKhvSIgXD/6MRX22dxLEAIjPW/xX3mxCmJ7Zw uEF0xhHnaqwtr+Hc+xRIPOaIOPtFCnu7L+nN/hA0WYARr1alKfRLVEhIbZfn2e2SsO/5 SXh8B6/Z2dfHxxbQKj6oo0OmFA84B2XtWkLYu7ujMu3Ir0+bV7MYwMaFgiHqXPzWa8V9 ltqozeKU/bm6aZmNw1Gfu/BqE1+MBEw6EevOdP0uFk+YMD6z7Mm9xgF/Iq2h+JlodC4V AoWA== 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=vxpOS8PLcNe+jmXIP+9QWAUopOfZBzCDoZVRFKo3uYg=; b=zPlA73zk0zhs24QhrVwF0cVu6HWmlDmGQrq0jjWeR9BJ6VmVbf+5zcDLRT0yzddRyO wLXBJ+DbFrfT5VkmC+WXS2hgWAUNiDT+//10qxa3b7hEAp+rHQuiHQPgflVdzmmUJ6V7 LzDw62+kPKT4LePVoowjJUMZN/rEIVGud+UHpdbQKthuTEiTyqxobYbFgMkldQXzsBb0 PEFZywciqh2CEjvZuO3GLej+TGQwR4EXl967cXzlWjcNOrHHnBK2Wmib8I2BzKZNn6kn t/ujpJhuxTP3VBjA88ZH2qdLLDOgPZyzW9rtrubofmPs+mNyOCafSr+KavZwm65x97xA uXnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fICt1+hE; 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 h9si3700730pgr.527.2017.11.18.00.48.55; Sat, 18 Nov 2017 00:49:08 -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=fICt1+hE; 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 S1761958AbdKQU7w (ORCPT + 93 others); Fri, 17 Nov 2017 15:59:52 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:34461 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761905AbdKQU72 (ORCPT ); Fri, 17 Nov 2017 15:59:28 -0500 Received: by mail-pg0-f66.google.com with SMTP id 4so2800316pge.1; Fri, 17 Nov 2017 12:59:28 -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=vxpOS8PLcNe+jmXIP+9QWAUopOfZBzCDoZVRFKo3uYg=; b=fICt1+hESnsABnSOSyu+/uO1k4dYFagPSuRORNqOI8+zXgYcVyDVZjsD80m798syxp mEJhCRn9d/0hNWHudGrQXnC0EGd4tEW8Nm7rZy4SqK1sYBDmjzGuLR4UJ57fnqKEtzuF AZ4jWZ9uNZ++NMRXIdMbisTr5U1U2IRTdyOLccebRFkBUw/s0NTw22E3zPjp3ehLGLKq D9ouu4xvTob69IqafftQ+GZkUth12NcxYU+U99NBeRHqKuww73SNGACDlozCkxI9EYb0 LYhR4+h7TP+qdNztdHCGweZlEjkVviNgC/5gV0LLyQ2p3MFp4hYXdSgvKiKG/GuXmcgI WWtA== 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=vxpOS8PLcNe+jmXIP+9QWAUopOfZBzCDoZVRFKo3uYg=; b=jkwBQX8gOsJ58FrT5Xf/n+HhBTJVw9Th83d6tAD641SzYkqDhEOErWQCp3Key9zrN3 i1LGc10MKMNxxVEvKUldn6k84x2nFD7U1uWn+qBme98KnmuqzBkuL8hCPlO4tlxOfWXL jyOVFx+0cTn/03I19Nlj4Slw3t+G5BhULPZzowuBz+CKULujSf37N3Qq/a4ZYaKr71B7 0rIAusQowrOelPJI8dASH16Bw61G59hOhGu39IAY7iKIZuATTGjkfNzZz+HHTuO9lqR4 gamJ5uGYJ30LlTv6R7IXi1pkqkzVar01E6uZsYohO7wHyTANYxJ/ID+Pa6U1O1s3+87r Y3Lw== X-Gm-Message-State: AJaThX68TSS++oojdfAqm0gtMF12hROHdgIbB0I8VkYoGF2/YdFhDchy zGQbzHRn88tony4+sFu+9/FoPq8f X-Received: by 10.84.175.3 with SMTP id s3mr6395895plb.440.1510952368266; Fri, 17 Nov 2017 12:59:28 -0800 (PST) Received: from localhost.localdomain ([103.16.68.147]) by smtp.gmail.com with ESMTPSA id f12sm7650857pga.7.2017.11.17.12.59.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Nov 2017 12:59:27 -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 4/10 v2] Input: serio: Fix platform_get_irq's error checking Date: Sat, 18 Nov 2017 02:28:50 +0530 Message-Id: <8104ffc3b7bedee525c0cba9144cedaf04087fd4.1510951446.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. 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 1584369744710184483@xxx Sat Nov 18 02:38:53 +0000 2017 X-GM-THRID: 1584369744710184483 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread