提交 4ab73761 编写于 作者: R Roel Kluin 提交者: 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: NRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
上级 bc34496d
...@@ -57,7 +57,7 @@ static int amba_kmi_write(struct serio *io, unsigned char val) ...@@ -57,7 +57,7 @@ static int amba_kmi_write(struct serio *io, unsigned char val)
struct amba_kmi_port *kmi = io->port_data; struct amba_kmi_port *kmi = io->port_data;
unsigned int timeleft = 10000; /* timeout in 100ms */ unsigned int timeleft = 10000; /* timeout in 100ms */
while ((readb(KMISTAT) & KMISTAT_TXEMPTY) == 0 && timeleft--) while ((readb(KMISTAT) & KMISTAT_TXEMPTY) == 0 && --timeleft)
udelay(10); udelay(10);
if (timeleft) if (timeleft)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册