Commit da8e94e0 authored by Dan Carpenter's avatar Dan Carpenter Committed by Kleber Sacilotto de Souza

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

BugLink: https://bugs.launchpad.net/bugs/1864773

[ Upstream commit 4d8f727b ]

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

Fixes: 1158f0f1 ("Input: add support for Nomadik SKE keypad controller")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 62dd3a64
...@@ -100,7 +100,7 @@ static int __init ske_keypad_chip_init(struct ske_keypad *keypad) ...@@ -100,7 +100,7 @@ static int __init ske_keypad_chip_init(struct ske_keypad *keypad)
while ((readl(keypad->reg_base + SKE_RIS) != 0x00000000) && timeout--) while ((readl(keypad->reg_base + SKE_RIS) != 0x00000000) && timeout--)
cpu_relax(); cpu_relax();
if (!timeout) if (timeout == -1)
return -EINVAL; return -EINVAL;
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment