Skip to contentSkip to conversation

Input: tnetv107x-keypad - make irqs signed for error handling

PATCH Applied Dan Carpenter 2 participants 2 messages Nov 7, 2013 – Nov 11, 2013

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

PATCH 1/1 Input: tnetv107x-keypad - make irqs signed for error handling

There is a bug in keypad_probe() where we do:

	kp->irq_press   = platform_get_irq_byname(pdev, "press");
	kp->irq_release = platform_get_irq_byname(pdev, "release");
	if (kp->irq_press < 0 || kp->irq_release < 0) {

The problem is that these irq variables are unsigned so the error handling doesn't work. I've changed them to signed values.

drivers/input/keyboard/tnetv107x-keypad.c +2 -2
index 5f7b427..8bd24d5 100644
@@ -60,8 +60,8 @@ struct keypad_data {
 	struct clk			*clk;
 	struct device			*dev;
 	spinlock_t			lock;
-	u32				irq_press;
-	u32				irq_release;
+	int				irq_press;
+	int				irq_release;
 	int				rows, cols, row_shift;
 	int				debounce_ms, active_low;
 	u32				prev_keys[3];
maintainer Applied
#1 lore raw
Quoted 10 lines · Dan Carpenter

There is a bug in keypad_probe() where we do:

	kp->irq_press   = platform_get_irq_byname(pdev, "press");
	kp->irq_release = platform_get_irq_byname(pdev, "release");
	if (kp->irq_press < 0 || kp->irq_release < 0) {

The problem is that these irq variables are unsigned so the error handling doesn't work. I've changed them to signed values.

Applied, thank you.

Signature · 1 line
Dmitry