From: Arvind Yadav <arvind.yadav.cs@gmail.com>
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 [thread overview]
Message-ID: <8104ffc3b7bedee525c0cba9144cedaf04087fd4.1510951446.git.arvind.yadav.cs@gmail.com> (raw)
In-Reply-To: <f317ec56b23b11b79284c29d12a7004575aa35db.1510951446.git.arvind.yadav.cs@gmail.com>
In-Reply-To: <f317ec56b23b11b79284c29d12a7004575aa35db.1510951446.git.arvind.yadav.cs@gmail.com>
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 <arvind.yadav.cs@gmail.com>
---
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
next prev parent reply other threads:[~2017-11-17 20:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-17 20:58 [PATCH 1/3 v2] Input: omap4-keypad: " Arvind Yadav
2017-11-17 20:58 ` [PATCH 2/3 v2] Input: twl4030_keypad: " Arvind Yadav
2017-11-18 8:20 ` Russell King - ARM Linux
2017-11-17 20:58 ` Arvind Yadav [this message]
2017-11-18 8:20 ` [PATCH 4/10 v2] Input: serio: " Russell King - ARM Linux
2017-11-18 8:20 ` [PATCH 1/3 v2] Input: omap4-keypad: " Russell King - ARM Linux
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8104ffc3b7bedee525c0cba9144cedaf04087fd4.1510951446.git.arvind.yadav.cs@gmail.com \
--to=arvind.yadav.cs@gmail.com \
--cc=daniel.thompson@linaro.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=maxime.ripard@free-electrons.com \
--cc=mcuos.com@gmail.com \
--cc=wens@csie.org \
--cc=wsa@the-dreams.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®