diff options
Diffstat (limited to 'sys/dev/kbd')
-rw-r--r-- | sys/dev/kbd/kbd.c | 14 | ||||
-rw-r--r-- | sys/dev/kbd/kbdreg.h | 1 |
2 files changed, 8 insertions, 7 deletions
diff --git a/sys/dev/kbd/kbd.c b/sys/dev/kbd/kbd.c index 8ebba7e..ce55b65 100644 --- a/sys/dev/kbd/kbd.c +++ b/sys/dev/kbd/kbd.c @@ -54,6 +54,8 @@ typedef struct genkbd_softc { static SLIST_HEAD(, keyboard_driver) keyboard_drivers = SLIST_HEAD_INITIALIZER(keyboard_drivers); +SET_DECLARE(kbddriver_set, const keyboard_driver_t); + /* local arrays */ /* @@ -199,8 +201,8 @@ kbd_register(keyboard_t *kbd) return index; } } - list = (const keyboard_driver_t **)kbddriver_set.ls_items; - while ((p = *list++) != NULL) { + SET_FOREACH(list, kbddriver_set) { + p = *list; if (strcmp(p->name, kbd->kb_name) == 0) { keyboard[index] = kbd; kbdsw[index] = p->kbdsw; @@ -254,8 +256,8 @@ keyboard_switch_t if (strcmp(p->name, driver) == 0) return p->kbdsw; } - list = (const keyboard_driver_t **)kbddriver_set.ls_items; - while ((p = *list++) != NULL) { + SET_FOREACH(list, kbddriver_set) { + p = *list; if (strcmp(p->name, driver) == 0) return p->kbdsw; } @@ -393,8 +395,8 @@ kbd_configure(int flags) if (p->configure != NULL) (*p->configure)(flags); } - list = (const keyboard_driver_t **)kbddriver_set.ls_items; - while ((p = *list++) != NULL) { + SET_FOREACH(list, kbddriver_set) { + p = *list; if (p->configure != NULL) (*p->configure)(flags); } diff --git a/sys/dev/kbd/kbdreg.h b/sys/dev/kbd/kbdreg.h index de7d941..55e0cef 100644 --- a/sys/dev/kbd/kbdreg.h +++ b/sys/dev/kbd/kbdreg.h @@ -173,7 +173,6 @@ typedef struct keyboard_driver { /* global variables */ extern keyboard_switch_t **kbdsw; -extern struct linker_set kbddriver_set; /* functions for the keyboard driver */ int kbd_add_driver(keyboard_driver_t *driver); |