diff options
author | Gabe Black <gabeblack@chromium.org> | 2011-11-14 20:18:12 +0000 |
---|---|---|
committer | Graeme Russ <graeme.russ@gmail.com> | 2011-11-29 21:31:35 +1100 |
commit | 22e0f5a9ecab85f36a0fe69892d950c1ac212c91 (patch) | |
tree | e337a2fdd823afc82ce66a2bad443a0babfec4bc /arch/powerpc/cpu/74xx_7xx/cpu.c | |
parent | dd4a5b2246e34c59343c5bdb7bdced71e46d4ad5 (diff) | |
download | u-boot-imx-22e0f5a9ecab85f36a0fe69892d950c1ac212c91.zip u-boot-imx-22e0f5a9ecab85f36a0fe69892d950c1ac212c91.tar.gz u-boot-imx-22e0f5a9ecab85f36a0fe69892d950c1ac212c91.tar.bz2 |
x86: Fix some bugs in the i8402 driver when no controller is present
If no controller is present, the i8402 driver should return immediately and
not attempt to operate on the missing hardware.
In kbd_input_empty, the status register is checked every millisecond to see
whether the input buffer is empty, up to a timeout which is tracked by
decrimenting a counter each time the check is performed. The decrement is
performed with a postfix -- operator, and the value of the counter is
checked in place. That means that when the counter reaches zero and the
loop terminates, it will actually be decrimented one more time and become
-1. That value is returned as the return value of the function. That would
give the right answer if it wasn't for that extra decrement because a
timeout would indicate that the buffer never became empty.
This change fixes both of those bugs.
Signed-off-by: Gabe Black <gabeblack@chromium.org>
Diffstat (limited to 'arch/powerpc/cpu/74xx_7xx/cpu.c')
0 files changed, 0 insertions, 0 deletions