mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-21 14:41:31 +00:00
i8042: Adjust keyboard init to assume success
Modify i8042_kbd_init() so that the normal pass is sucessful init and failure exits early. This will make the code easier to extend and is easier to read. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
parent
4f087bace2
commit
c5d257f93f
1 changed files with 9 additions and 10 deletions
|
@ -585,18 +585,17 @@ int i8042_kbd_init(void)
|
||||||
keymap = KBD_GER;
|
keymap = KBD_GER;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (try = 0; try < KBD_RESET_TRIES; try++) {
|
for (try = 0; kbd_reset() != 0; try++) {
|
||||||
if (kbd_reset() == 0) {
|
if (try >= KBD_RESET_TRIES)
|
||||||
kbd_mapping = keymap;
|
return -1;
|
||||||
kbd_flags = NORMAL;
|
|
||||||
kbd_state = 0;
|
|
||||||
kbd_led_set();
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
kbd_mapping = keymap;
|
||||||
|
kbd_flags = NORMAL;
|
||||||
|
kbd_state = 0;
|
||||||
|
kbd_led_set();
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Reference in a new issue