Commit 4ab73761 authored by Roel Kluin's avatar Roel Kluin Committed by Dmitry Torokhov

Input: ambakmi - fix timeout handling in amba_kmi_write()

With a postfix decrement timeleft reaches -1 rather than 0,
but after the loop it is tested to have become 0.
Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent bc34496d
......@@ -57,7 +57,7 @@ static int amba_kmi_write(struct serio *io, unsigned char val)
struct amba_kmi_port *kmi = io->port_data;
unsigned int timeleft = 10000; /* timeout in 100ms */
while ((readb(KMISTAT) & KMISTAT_TXEMPTY) == 0 && timeleft--)
while ((readb(KMISTAT) & KMISTAT_TXEMPTY) == 0 && --timeleft)
udelay(10);
if (timeleft)
......
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