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 <[email protected]>
---
changes ib v2 :
Return error(irq) insted of -EINVAL.
drivers/input/keyboard/omap4-keypad.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c
index 940d38b..9ad840c 100644
--- a/drivers/input/keyboard/omap4-keypad.c
+++ b/drivers/input/keyboard/omap4-keypad.c
@@ -251,9 +251,9 @@ static int omap4_keypad_probe(struct platform_device *pdev)
}
irq = platform_get_irq(pdev, 0);
- if (!irq) {
+ if (irq < 0) {
dev_err(&pdev->dev, "no keyboard irq assigned\n");
- return -EINVAL;
+ return irq;
}
keypad_data = kzalloc(sizeof(struct omap4_keypad), GFP_KERNEL);
--
2.7.4
From 1584440832917333598@xxx Sat Nov 18 21:28:48 +0000 2017
X-GM-THRID: 1584295092137456259
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread
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 <[email protected]>
---
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