Skip to contentSkip to conversation

Input: wm97xx - use EBUSY instead of EINVAL

PATCH In review Joonyoung Shim 3 participants 6 messages Jun 3, 2009 – Jun 4, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Input: wm97xx - use EBUSY instead of EINVAL

If request_irq() fails, we have to return -EBUSY instead of -EINVAL.

---
 drivers/input/touchscreen/wm97xx-core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/input/touchscreen/wm97xx-core.c +1 -1
index 2957d48..06cc8cf 100644
@@ -375,7 +375,7 @@ static int wm97xx_init_pen_irq(struct wm97xx *wm)
 		dev_err(wm->dev,
 			"Failed to register pen down interrupt, polling");
 		wm->pen_irq = 0;
-		return -EINVAL;
+		return -EBUSY;
 	}
 
 	/* Configure GPIO as interrupt source on WM971x */
Signature · 1 line
1.6.0.4
#1 lore raw
Quoted 1 line · Joonyoung Shim

If request_irq() fails, we have to return -EBUSY instead of -EINVAL.

Could you provide a bit more explanation for this one, please? -EBUSY seems to give entirely the wrong impression to applications since in the systems where this driver will be deployed a failure to acquire the IRQ is most likely to be due to incorrect platform data and it is highly unlikely to resolve itself.

maintainer
#2 lore raw
Quoted 8 lines · Mark Brown
Quoted 1 line · Joonyoung Shim

If request_irq() fails, we have to return -EBUSY instead of -EINVAL.

Could you provide a bit more explanation for this one, please? -EBUSY seems to give entirely the wrong impression to applications since in the systems where this driver will be deployed a failure to acquire the IRQ is most likely to be due to incorrect platform data and it is highly unlikely to resolve itself.

The "most correct" thing would be to propagate the value returned by request_irq() I think but since nobidy actually uses result of wm97xx_init_pen_irq() I just would not bother at all.

Signature · 1 line
Dmitry
#3 lore raw
Quoted 3 lines · Dmitry Torokhov

The "most correct" thing would be to propagate the value returned by request_irq() I think but since nobidy actually uses result of wm97xx_init_pen_irq() I just would not bother at all.

Yeah, I was looking at that - the driver can run in polling mode so it's fine as-is. I could change the code to return void, I suppose.

maintainer
#4 lore raw
Quoted 7 lines · On Wednesday 03 June 2009 07:40:24 Mark Brown wrote:
Quoted 3 lines · Dmitry Torokhov

The "most correct" thing would be to propagate the value returned by request_irq() I think but since nobidy actually uses result of wm97xx_init_pen_irq() I just would not bother at all.

Yeah, I was looking at that - the driver can run in polling mode so it's fine as-is. I could change the code to return void, I suppose.

Yes, I think that would be the best.

Signature · 1 line
Dmitry
#5 lore raw
In reply to Mark Brown
Quoted 8 lines · Mark Brown
Quoted 1 line · Joonyoung Shim

If request_irq() fails, we have to return -EBUSY instead of -EINVAL.

Could you provide a bit more explanation for this one, please? -EBUSY seems to give entirely the wrong impression to applications since in the systems where this driver will be deployed a failure to acquire the IRQ is most likely to be due to incorrect platform data and it is highly unlikely to resolve itself.

-EBUSY is used in many touchscreen drivers currently, but i agree dmitry opinion to propagate what request_irq() returned because request_irq() can return different errnos.

Thanks.