Skip to contentSkip to conversation

Input: lpc32xx-keys - fix invalid error handling of a requested irq

PATCH New Vladimir Zapolskiy 3 participants 5 messages Dec 5, 2016 – Dec 8, 2016

Subsystems (3)
lore
Share & tools
lore

Vladimir Zapolskiy

author maintainer
#0 lore raw

PATCH 1/1 Input: lpc32xx-keys - fix invalid error handling of a requested irq

Semantics of NR_IRQS is different on machines with SPARSE_IRQ option disabled or enabled, in the latter case IRQs are allocated starting at least from the value specified by NR_IRQS and going upwards, so the check of (irq >= NR_IRQ) to decide about an error code returned by platform_get_irq() is completely invalid, don't attempt to overrule irq subsystem in the driver.

The change fixes lpc32xx_keys driver initialization on boot:

lpc32xx_keys 40050000.key: failed to get platform irq
lpc32xx_keys: probe of 40050000.key failed with error -22

---
 drivers/input/keyboard/lpc32xx-keys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/keyboard/lpc32xx-keys.c +1 -1
index 265d641..632523d 100644
@@ -182,7 +182,7 @@ static int lpc32xx_kscan_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0 || irq >= NR_IRQS) {
+	if (irq < 0) {
 		dev_err(&pdev->dev, "failed to get platform irq\n");
 		return -EINVAL;
 	}
Signature · 1 line
2.10.2
#1 lore raw

PATCH 1/1 Input: lpc32xx-keys - fix invalid error handling of a requested irq

Quoted 9 lines · Vladimir Zapolskiy

Semantics of NR_IRQS is different on machines with SPARSE_IRQ option disabled or enabled, in the latter case IRQs are allocated starting at least from the value specified by NR_IRQS and going upwards, so the check of (irq >= NR_IRQ) to decide about an error code returned by platform_get_irq() is completely invalid, don't attempt to overrule irq subsystem in the driver.

The change fixes lpc32xx_keys driver initialization on boot:

Quoted 8 lines

lpc32xx_keys 40050000.key: failed to get platform irq
lpc32xx_keys: probe of 40050000.key failed with error -22

---
 drivers/input/keyboard/lpc32xx-keys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Cosmetic - please update the subject line when doing the commit:
replace " -" by ":" after lpc32xx-keys

maintainer
#2 lore raw

PATCH 1/1 Input: lpc32xx-keys - fix invalid error handling of a requested irq

Quoted 14 lines · Sylvain Lemieux
Quoted 4 lines · Vladimir Zapolskiy

Semantics of NR_IRQS is different on machines with SPARSE_IRQ option disabled or enabled, in the latter case IRQs are allocated starting at least from the value specified by NR_IRQS and going upwards, so the check of (irq >= NR_IRQ) to decide about an error code returned

by

Quoted 8 lines

platform_get_irq() is completely invalid, don't attempt to overrule irq subsystem in the driver.

The change fixes lpc32xx_keys driver initialization on boot:

lpc32xx_keys 40050000.key: failed to get platform irq
lpc32xx_keys: probe of 40050000.key failed with error -22

Quoted 7 lines
Quoted 5 lines
---
 drivers/input/keyboard/lpc32xx-keys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Cosmetic - please update the subject line when doing the commit:
replace " -" by ":" after lpc32xx-keys

Why? The format on all input patches is "Input: <driver> - <subject>" and had been this for 10+ years.

Thanks.

Signature · 1 line
Dmitry
#3 lore raw

PATCH 1/1 Input: lpc32xx-keys - fix invalid error handling of a requested irq

Quoted 20 lines · Dmitry Torokhov
Quoted 19 lines · Sylvain Lemieux
Quoted 4 lines · Vladimir Zapolskiy

Semantics of NR_IRQS is different on machines with SPARSE_IRQ option disabled or enabled, in the latter case IRQs are allocated starting at least from the value specified by NR_IRQS and going upwards, so the check of (irq >= NR_IRQ) to decide about an error code returned

by

Quoted 13 lines

platform_get_irq() is completely invalid, don't attempt to overrule irq subsystem in the driver.

The change fixes lpc32xx_keys driver initialization on boot:

lpc32xx_keys 40050000.key: failed to get platform irq
lpc32xx_keys: probe of 40050000.key failed with error -22

---
 drivers/input/keyboard/lpc32xx-keys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 5 lines
Quoted 2 lines

Cosmetic - please update the subject line when doing the commit:
replace " -" by ":" after lpc32xx-keys

Why? The format on all input patches is "Input: <driver> - <subject>" and had been this for 10+ years.

My mistake; did not look at the tree "subject line" commit log

You can dropped my comment.

Regards,
Sylvain

Quoted 3 lines

Thanks.

maintainer Applied
#4 lore raw

PATCH 1/1 Input: lpc32xx-keys - fix invalid error handling of a requested irq

In reply to Sylvain Lemieux
Quoted 18 lines · Sylvain Lemieux
Quoted 9 lines · Vladimir Zapolskiy

Semantics of NR_IRQS is different on machines with SPARSE_IRQ option disabled or enabled, in the latter case IRQs are allocated starting at least from the value specified by NR_IRQS and going upwards, so the check of (irq >= NR_IRQ) to decide about an error code returned by platform_get_irq() is completely invalid, don't attempt to overrule irq subsystem in the driver.

The change fixes lpc32xx_keys driver initialization on boot:

Quoted 8 lines

lpc32xx_keys 40050000.key: failed to get platform irq
lpc32xx_keys: probe of 40050000.key failed with error -22

---
 drivers/input/keyboard/lpc32xx-keys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 4 lines

Cosmetic - please update the subject line when doing the commit:
replace " -" by ":" after lpc32xx-keys

Applied, thank you.

Signature · 1 line
Dmitry