2017-11-19 04:00:40

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 01/10 v3] Input: ep93xx_keypad: Fix platform_get_irq's error checking

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:
Return keypad->irq insted of -ENXIO.
changes in v3 :
Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.

drivers/input/keyboard/ep93xx_keypad.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c
index f77b295..01788a7 100644
--- a/drivers/input/keyboard/ep93xx_keypad.c
+++ b/drivers/input/keyboard/ep93xx_keypad.c
@@ -257,8 +257,8 @@ static int ep93xx_keypad_probe(struct platform_device *pdev)
}

keypad->irq = platform_get_irq(pdev, 0);
- if (!keypad->irq) {
- err = -ENXIO;
+ if (keypad->irq <= 0) {
+ err = keypad->irq;
goto failed_free;
}

--
2.7.4


From 1586258716916079661@xxx Fri Dec 08 23:03:17 +0000 2017
X-GM-THRID: 1584360675204398715
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread


2017-11-19 04:01:16

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 02/10 v3] Input: omap4-keypad: Fix platform_get_irq's error checking

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:
Return irq insted of -EINVAL.
changes in v3 :
Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.

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 1584465824458831155@xxx Sun Nov 19 04:06:02 +0000 2017
X-GM-THRID: 1584465824458831155
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread

2017-11-19 04:01:49

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 08/10 v3] Input: twl4030-pwrbutton: Handle return value of platform_get_irq

platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <[email protected]>
---
changes in v2 :
return irq instead of -ENODEV.
changes in v3 :
Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.

drivers/input/misc/twl4030-pwrbutton.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/input/misc/twl4030-pwrbutton.c b/drivers/input/misc/twl4030-pwrbutton.c
index b307cca..0dcf311 100644
--- a/drivers/input/misc/twl4030-pwrbutton.c
+++ b/drivers/input/misc/twl4030-pwrbutton.c
@@ -58,6 +58,9 @@ static int twl4030_pwrbutton_probe(struct platform_device *pdev)
int irq = platform_get_irq(pdev, 0);
int err;

+ if (irq <= 0)
+ return irq;
+
pwr = devm_input_allocate_device(&pdev->dev);
if (!pwr) {
dev_err(&pdev->dev, "Can't allocate power button\n");
--
2.7.4


From 1584463789928836154@xxx Sun Nov 19 03:33:41 +0000 2017
X-GM-THRID: 1584369524800906590
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread

2017-11-19 04:03:17

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 06/10 v2] Input: w90p910_ts: Handle return value of platform_get_irq

platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <[email protected]>
---
changes in v2 :
Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.

drivers/input/touchscreen/w90p910_ts.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/input/touchscreen/w90p910_ts.c b/drivers/input/touchscreen/w90p910_ts.c
index 638c1d7..fa74f2c 100644
--- a/drivers/input/touchscreen/w90p910_ts.c
+++ b/drivers/input/touchscreen/w90p910_ts.c
@@ -277,6 +277,10 @@ static int w90x900ts_probe(struct platform_device *pdev)
input_set_drvdata(input_dev, w90p910_ts);

w90p910_ts->irq_num = platform_get_irq(pdev, 0);
+ if (w90p910_ts->irq_num <= 0) {
+ err = w90p910_ts->irq_num;
+ goto fail4;
+ }
if (request_irq(w90p910_ts->irq_num, w90p910_ts_interrupt,
0, "w90p910ts", w90p910_ts)) {
err = -EBUSY;
--
2.7.4


From 1584469917664831487@xxx Sun Nov 19 05:11:05 +0000 2017
X-GM-THRID: 1584469917664831487
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread

2017-11-19 04:01:36

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 05/10 v3] Input: cpcap-pwrbutton: Handle return value of platform_get_irq

platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <[email protected]>
---
changes in v2 :
return irq instead of -ENODEV.
changes in v3 :
Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.

drivers/input/misc/cpcap-pwrbutton.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/input/misc/cpcap-pwrbutton.c b/drivers/input/misc/cpcap-pwrbutton.c
index 0abef63..3a0626b 100644
--- a/drivers/input/misc/cpcap-pwrbutton.c
+++ b/drivers/input/misc/cpcap-pwrbutton.c
@@ -57,6 +57,9 @@ static int cpcap_power_button_probe(struct platform_device *pdev)
int irq = platform_get_irq(pdev, 0);
int err;

+ if (irq <= 0)
+ return irq;
+
button = devm_kmalloc(&pdev->dev, sizeof(*button), GFP_KERNEL);
if (!button)
return -ENOMEM;
--
2.7.4


From 1584455862608923981@xxx Sun Nov 19 01:27:41 +0000 2017
X-GM-THRID: 1583410704181694636
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread

2017-11-19 04:03:27

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 10/10 v2] Input: palmas-pwrbutton: Handle return value of platform_get_irq

platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <[email protected]>
---
changes in v2 :
Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.

drivers/input/misc/palmas-pwrbutton.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/input/misc/palmas-pwrbutton.c b/drivers/input/misc/palmas-pwrbutton.c
index 1e1baed..f9b05cf 100644
--- a/drivers/input/misc/palmas-pwrbutton.c
+++ b/drivers/input/misc/palmas-pwrbutton.c
@@ -210,6 +210,11 @@ static int palmas_pwron_probe(struct platform_device *pdev)
INIT_DELAYED_WORK(&pwron->input_work, palmas_power_button_work);

pwron->irq = platform_get_irq(pdev, 0);
+ if (pwron->irq <= 0) {
+ error = pwron->irq;
+ goto err_free_input;
+ }
+
error = request_threaded_irq(pwron->irq, NULL, pwron_irq,
IRQF_TRIGGER_HIGH |
IRQF_TRIGGER_LOW |
--
2.7.4


From 1584610847004088533@xxx Mon Nov 20 18:31:06 +0000 2017
X-GM-THRID: 1584610847004088533
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread

2017-11-19 04:01:41

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 07/10 v3] Input: sun4i-ts: Handle return value of platform_get_irq

platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <[email protected]>
---
changes in v2 :
ts->irq is unsigned. used int irq variable.
changes in v3 :
Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.

drivers/input/touchscreen/sun4i-ts.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/sun4i-ts.c b/drivers/input/touchscreen/sun4i-ts.c
index d2e14d9..315f26b 100644
--- a/drivers/input/touchscreen/sun4i-ts.c
+++ b/drivers/input/touchscreen/sun4i-ts.c
@@ -251,6 +251,7 @@ static int sun4i_ts_probe(struct platform_device *pdev)
bool ts_attached;
u32 tp_sensitive_adjust = 15;
u32 filter_type = 1;
+ int irq;

ts = devm_kzalloc(dev, sizeof(struct sun4i_ts_data), GFP_KERNEL);
if (!ts)
@@ -314,7 +315,10 @@ static int sun4i_ts_probe(struct platform_device *pdev)
if (IS_ERR(ts->base))
return PTR_ERR(ts->base);

- ts->irq = platform_get_irq(pdev, 0);
+ irq = platform_get_irq(pdev, 0);
+ if (irq <= 0)
+ return irq;
+ ts->irq = irq;
error = devm_request_irq(dev, ts->irq, sun4i_ts_irq, 0, "sun4i-ts", ts);
if (error)
return error;
--
2.7.4


From 1584231437051735781@xxx Thu Nov 16 14:00:32 +0000 2017
X-GM-THRID: 1584231437051735781
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread

2017-11-19 04:01:45

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 03/10 v3] Input: twl4030_keypad: Fix platform_get_irq's error checking

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 :
kp->irq is unsigned. use temporary int variable irq.
changes in v3 :
Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.

drivers/input/keyboard/twl4030_keypad.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/input/keyboard/twl4030_keypad.c b/drivers/input/keyboard/twl4030_keypad.c
index f9f98ef..d921238 100644
--- a/drivers/input/keyboard/twl4030_keypad.c
+++ b/drivers/input/keyboard/twl4030_keypad.c
@@ -341,6 +341,7 @@ static int twl4030_kp_probe(struct platform_device *pdev)
struct input_dev *input;
u8 reg;
int error;
+ int irq;

kp = devm_kzalloc(&pdev->dev, sizeof(*kp), GFP_KERNEL);
if (!kp)
@@ -388,11 +389,12 @@ static int twl4030_kp_probe(struct platform_device *pdev)
return -EINVAL;
}

- kp->irq = platform_get_irq(pdev, 0);
- if (!kp->irq) {
+ irq = platform_get_irq(pdev, 0);
+ if (irq <= 0) {
dev_err(&pdev->dev, "no keyboard irq assigned\n");
- return -EINVAL;
+ return irq;
}
+ kp->irq = irq;

error = matrix_keypad_build_keymap(keymap_data, NULL,
TWL4030_MAX_ROWS,
--
2.7.4


From 1584165557873432859@xxx Wed Nov 15 20:33:25 +0000 2017
X-GM-THRID: 1584165557873432859
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread

2017-11-19 04:01:10

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 04/10 v3] Input: serio: Fix platform_get_irq's error checking

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.
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

2017-11-19 04:02:24

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 09/10 v2] Input: sirfsoc-onkey: Handle return value of platform_get_irq

platform_get_irq() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <[email protected]>
---
changes in v2 :
Add failure case '<= 0' instead of '< 0'. IRQ0 is not valid.

drivers/input/misc/sirfsoc-onkey.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/input/misc/sirfsoc-onkey.c b/drivers/input/misc/sirfsoc-onkey.c
index 4fd038d..de04b48 100644
--- a/drivers/input/misc/sirfsoc-onkey.c
+++ b/drivers/input/misc/sirfsoc-onkey.c
@@ -149,6 +149,9 @@ static int sirfsoc_pwrc_probe(struct platform_device *pdev)
sirfsoc_pwrc_toggle_interrupts(pwrcdrv, false);

irq = platform_get_irq(pdev, 0);
+ if (irq <= 0)
+ return irq;
+
error = devm_request_irq(&pdev->dev, irq,
sirfsoc_pwrc_isr, 0,
"sirfsoc_pwrc_int", pwrcdrv);
--
2.7.4


From 1583491529429531022@xxx Wed Nov 08 10:00:01 +0000 2017
X-GM-THRID: 1583488449546042193
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread