Skip to contentSkip to conversation

Input: nomadik-ske-keypad - Fix a loop timeout test

PATCH Applied Dan Carpenter 2 participants 2 messages Dec 18, 2018 – Dec 21, 2018

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

PATCH 1/1 Input: nomadik-ske-keypad - Fix a loop timeout test

The loop exits with "timeout" set to -1 not to 0.

Fixes 1158f0f16224 ("Input: add support for Nomadik SKE keypad controller")
---
 drivers/input/keyboard/nomadik-ske-keypad.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/keyboard/nomadik-ske-keypad.c +1 -1
index 8567ee47761e..ae3b04557074 100644
@@ -100,7 +100,7 @@ static int __init ske_keypad_chip_init(struct ske_keypad *keypad)
 	while ((readl(keypad->reg_base + SKE_RIS) != 0x00000000) && timeout--)
 		cpu_relax();
 
-	if (!timeout)
+	if (timeout = -1)
 		return -EINVAL;
 
 	/*
Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw
Quoted 4 lines · Dan Carpenter

The loop exits with "timeout" set to -1 not to 0.

Fixes 1158f0f16224 ("Input: add support for Nomadik SKE keypad controller")

Applied, thank you.

Quoted 20 lines
---
 drivers/input/keyboard/nomadik-ske-keypad.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/keyboard/nomadik-ske-keypad.c +1 -1
index 8567ee47761e..ae3b04557074 100644
@@ -100,7 +100,7 @@ static int __init ske_keypad_chip_init(struct ske_keypad *keypad)
 	while ((readl(keypad->reg_base + SKE_RIS) != 0x00000000) && timeout--)
 		cpu_relax();
 
-	if (!timeout)
+	if (timeout = -1)
 		return -EINVAL;
 
 	/*
Signature · 1 line
2.17.1
Signature · 1 line
Dmitry