aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/serio
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-02-01 19:55:45 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-02-01 19:58:18 -0500
commit4ab73761faef832f6d378328f79d21e77c62af3b (patch)
tree109246d1a0453c950d2c02f3a062cae9c8b47304 /drivers/input/serio
parentbc34496d63ec0a669d6825ea42275fd6fcbe9969 (diff)
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: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/serio')
-rw-r--r--drivers/input/serio/ambakmi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c
index af159c7d60bc..e29cdc13a199 100644
--- a/drivers/input/serio/ambakmi.c
+++ b/drivers/input/serio/ambakmi.c
@@ -57,7 +57,7 @@ static int amba_kmi_write(struct serio *io, unsigned char val)
57 struct amba_kmi_port *kmi = io->port_data; 57 struct amba_kmi_port *kmi = io->port_data;
58 unsigned int timeleft = 10000; /* timeout in 100ms */ 58 unsigned int timeleft = 10000; /* timeout in 100ms */
59 59
60 while ((readb(KMISTAT) & KMISTAT_TXEMPTY) == 0 && timeleft--) 60 while ((readb(KMISTAT) & KMISTAT_TXEMPTY) == 0 && --timeleft)
61 udelay(10); 61 udelay(10);
62 62
63 if (timeleft) 63 if (timeleft)