Input: nomadik-ske-keypad - fix a loop timeout test
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 21 Dec 2018 08:38:30 +0000 (00:38 -0800)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 4 Apr 2019 15:14:04 +0000 (16:14 +0100)
commit 4d8f727b83bcd6702c2d210330872c9122d2d360 upstream.

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

Fixes: 1158f0f16224 ("Input: add support for Nomadik SKE keypad controller")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/input/keyboard/nomadik-ske-keypad.c

index 63332e2f86288f75827e95342f7043b47b09e472..e07f88c9588fd9ca6ac75b2174c8ae1e00ce51e6 100644 (file)
@@ -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;
 
        /*