handle lack of pckbd more gracefully
kb_init() panics, if no keyboard controller is found during self-test. Instead of panic, the driver should quit the init process and tell it the SEF . Change-Id: Icdfb7125f5d4062f46cfbbdbbb9e54ac4b273642
This commit is contained in:
parent
af4345b097
commit
e1e2bc96d2
1 changed files with 10 additions and 4 deletions
|
@ -250,7 +250,7 @@ kbc_read(void)
|
|||
/*
|
||||
* Initialize the keyboard hardware.
|
||||
*/
|
||||
static void
|
||||
static int
|
||||
kb_init(void)
|
||||
{
|
||||
int r, ccb;
|
||||
|
@ -272,8 +272,10 @@ kb_init(void)
|
|||
/* Execute Controller Self Test. */
|
||||
kbc_cmd0(0xAA);
|
||||
r = kbc_read();
|
||||
if (r != 0x55)
|
||||
panic("PCKBD: Controller self-test failed.\n");
|
||||
if (r != 0x55){
|
||||
printf("PCKBD: Controller self-test failed.\n");
|
||||
return EGENERIC;
|
||||
}
|
||||
|
||||
/* Set interrupt handler and enable keyboard IRQ. */
|
||||
irq_hook_id = KEYBOARD_IRQ; /* id to be returned on interrupt */
|
||||
|
@ -316,6 +318,7 @@ kb_init(void)
|
|||
kb_wait();
|
||||
|
||||
set_leds(0);
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -466,7 +469,10 @@ pckbd_init(int UNUSED(type), sef_init_info_t *UNUSED(info))
|
|||
init_timer(&tmr_kbd_wd);
|
||||
|
||||
/* Initialize the keyboard. */
|
||||
kb_init();
|
||||
int r;
|
||||
if((r = kb_init())!=OK){
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Announce the driver's presence. */
|
||||
if (aux_available != 0)
|
||||
|
|
Loading…
Reference in a new issue