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
/*
* Initialize the keyboard hardware.
*/
-static void
+static int
kb_init(void)
{
int r, ccb;
/* 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 */
kb_wait();
set_leds(0);
+ return OK;
}
/*
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)