Don't use a callout unnecessarily - especially not this early

This commit is contained in:
skrll 2016-07-11 10:55:35 +00:00
parent 6c143561b1
commit 83e52e0af5

View File

@ -1,4 +1,4 @@
/* $NetBSD: lk201_ws.c,v 1.9 2015/01/02 21:32:26 jklos Exp $ */ /* $NetBSD: lk201_ws.c,v 1.10 2016/07/11 10:55:35 skrll Exp $ */
/* /*
* Copyright (c) 1998 * Copyright (c) 1998
@ -27,7 +27,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: lk201_ws.c,v 1.9 2015/01/02 21:32:26 jklos Exp $"); __KERNEL_RCSID(0, "$NetBSD: lk201_ws.c,v 1.10 2016/07/11 10:55:35 skrll Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -43,8 +43,6 @@ __KERNEL_RCSID(0, "$NetBSD: lk201_ws.c,v 1.9 2015/01/02 21:32:26 jklos Exp $");
void lk201_identify(void *); void lk201_identify(void *);
static callout_t lkkbd_id;
static const char *lkkbd_descr[] = { static const char *lkkbd_descr[] = {
"no keyboard", "no keyboard",
"LK-201 keyboard", "LK-201 keyboard",
@ -82,20 +80,6 @@ lk201_init(struct lk201_state *lks)
send(lks, LK_LED_ALL); send(lks, LK_LED_ALL);
lks->leds_state = 0; lks->leds_state = 0;
callout_init(&lkkbd_id, 0);
callout_setfunc(&lkkbd_id, lk201_identify, lks);
callout_schedule(&lkkbd_id, 0);
return (0);
}
void
lk201_identify(void *v)
{
struct lk201_state *lks = v;
int i;
callout_destroy(&lkkbd_id);
/* /*
* Swallow all the keyboard acknowledges from lk201_init(). * Swallow all the keyboard acknowledges from lk201_init().
* There should be 14 of them - one per LK_CMD_MODE command. * There should be 14 of them - one per LK_CMD_MODE command.
@ -133,6 +117,8 @@ lk201_identify(void *v)
lks->waitack = 0; lks->waitack = 0;
printf("lkkbd0: %s\n", lkkbd_descr[lks->kbdtype]); printf("lkkbd0: %s\n", lkkbd_descr[lks->kbdtype]);
return 0;
} }
int int