Skip to contentSkip to conversation

extcon: adc-jack: Fix checking return value of request_any_context_irq

PATCH Applied Axel Lin 3 participants 3 messages Sep 27, 2012 – Oct 2, 2012 External connector subsystem (extcon)

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 extcon: adc-jack: Fix checking return value of request_any_context_irq

On failure, request_any_context_irq() returns a negative value. On success, it returns either IRQC_IS_HARDIRQ or IRQC_IS_NESTED.

Also ensure adc_jack_probe() return 0 on success.

---
 drivers/extcon/extcon-adc-jack.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/extcon/extcon-adc-jack.c +2 -3
index 725eb5a..2cc6bec 100644
@@ -161,13 +161,12 @@ static int __devinit adc_jack_probe(struct platform_device *pdev)
 	err = request_any_context_irq(data->irq, adc_jack_irq_thread,
 			pdata->irq_flags, pdata->name, data);
 
-	if (err) {
+	if (err < 0) {
 		dev_err(&pdev->dev, "error: irq %d\n", data->irq);
-		err = -EINVAL;
 		goto err_irq;
 	}
 
-	goto out;
+	return 0;
 
 err_irq:
 	extcon_dev_unregister(&data->edev);
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 4 lines · Axel Lin

On failure, request_any_context_irq() returns a negative value. On success, it returns either IRQC_IS_HARDIRQ or IRQC_IS_NESTED.

Also ensure adc_jack_probe() return 0 on success.

this patch makes sense.

Quoted 26 lines
---
 drivers/extcon/extcon-adc-jack.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/extcon/extcon-adc-jack.c +2 -3
index 725eb5a..2cc6bec 100644
@@ -161,13 +161,12 @@ static int __devinit adc_jack_probe(struct platform_device *pdev)
 	err = request_any_context_irq(data->irq, adc_jack_irq_thread,
 			pdata->irq_flags, pdata->name, data);
 
-	if (err) {
+	if (err < 0) {
 		dev_err(&pdev->dev, "error: irq %d\n", data->irq);
-		err = -EINVAL;
 		goto err_irq;
 	}
 
-	goto out;
+	return 0;
 
 err_irq:
 	extcon_dev_unregister(&data->edev);
maintainer Applied
#2 lore raw
In reply to Axel Lin
Quoted 7 lines · Axel Lin

On failure, request_any_context_irq() returns a negative value. On success, it returns either IRQC_IS_HARDIRQ or IRQC_IS_NESTED.

Also ensure adc_jack_probe() return 0 on success.

---

Applied, thanks.

I applied two patch from Axel Lin at extcon git-tree and you can check it after some hours.
-
http://git.infradead.org/users/kmpark/linux-samsung/shortlog/refs/heads/extcon-for-next

Thank you,
Chanwoo Choi