Input: lpc32xx-keys - fix invalid error handling of a requested irq
Subsystems (3)
Vladimir Zapolskiy
maintainerPATCH 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
@@ -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
PATCH 1/1 Input: lpc32xx-keys - fix invalid error handling of a requested irq
Quoted 9 lines · Vladimir Zapolskiy
Semantics of
NR_IRQSis different on machines withSPARSE_IRQoption disabled or enabled, in the latter case IRQs are allocated starting at least from the value specified byNR_IRQSand going upwards, so the check of (irq >=NR_IRQ) to decide about an error code returned byplatform_get_irq()is completely invalid, don't attempt to overrule irq subsystem in the driver.The change fixes
lpc32xx_keysdriver initialization on boot:
Quoted 8 lines
lpc32xx_keys40050000.key: failed to get platform irq
lpc32xx_keys: probe of 40050000.key failed with error -22Signed-off-by Vladimir Zapolskiy <[email protected]>--- 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
Dmitry Torokhov
maintainerPATCH 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_IRQSis different on machines withSPARSE_IRQoption disabled or enabled, in the latter case IRQs are allocated starting at least from the value specified byNR_IRQSand going upwards, so the check of (irq >=NR_IRQ) to decide about an error code returnedby
Quoted 8 lines
platform_get_irq()is completely invalid, don't attempt to overrule irq subsystem in the driver.The change fixes
lpc32xx_keysdriver initialization on boot:
lpc32xx_keys40050000.key: failed to get platform irq
lpc32xx_keys: probe of 40050000.key failed with error -22
Quoted 7 lines
Quoted 5 lines
Signed-off-by Vladimir Zapolskiy <[email protected]>--- 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
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_IRQSis different on machines withSPARSE_IRQoption disabled or enabled, in the latter case IRQs are allocated starting at least from the value specified byNR_IRQSand going upwards, so the check of (irq >=NR_IRQ) to decide about an error code returnedby
Quoted 13 lines
platform_get_irq()is completely invalid, don't attempt to overrule irq subsystem in the driver.The change fixes
lpc32xx_keysdriver initialization on boot:
lpc32xx_keys40050000.key: failed to get platform irq
lpc32xx_keys: probe of 40050000.key failed with error -22Signed-off-by Vladimir Zapolskiy <[email protected]>--- 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-keysWhy? 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.
PATCH 1/1 Input: lpc32xx-keys - fix invalid error handling of a requested irq
In reply to Sylvain LemieuxQuoted 18 lines · Sylvain Lemieux
Quoted 9 lines · Vladimir Zapolskiy
Semantics of
NR_IRQSis different on machines withSPARSE_IRQoption disabled or enabled, in the latter case IRQs are allocated starting at least from the value specified byNR_IRQSand going upwards, so the check of (irq >=NR_IRQ) to decide about an error code returned byplatform_get_irq()is completely invalid, don't attempt to overrule irq subsystem in the driver.The change fixes
lpc32xx_keysdriver initialization on boot:Quoted 8 lines
lpc32xx_keys40050000.key: failed to get platform irq
lpc32xx_keys: probe of 40050000.key failed with error -22Signed-off-by Vladimir Zapolskiy <[email protected]>--- 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-keysAcked-by Sylvain Lemieux <[email protected]>
Applied, thank you.
Signature · 1 line
Dmitry