Skip to content

Commit

Permalink
Input: nomadik-ske-keypad - fix a loop timeout test
Browse files Browse the repository at this point in the history
The loop exits with "timeout" set to -1 not to 0.

Fixes: 1158f0f ("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>
  • Loading branch information
Dan Carpenter authored and Dmitry Torokhov committed Dec 21, 2018
1 parent 0832e93 commit 4d8f727
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/input/keyboard/nomadik-ske-keypad.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/*
Expand Down

0 comments on commit 4d8f727

Please sign in to comment.