Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/wscons Add wskbd_hotkey_deregister() to match wskbd_...



details:   https://anonhg.NetBSD.org/src/rev/9ff7bee2fcc5
branches:  trunk
changeset: 758204:9ff7bee2fcc5
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Tue Oct 26 05:12:34 2010 +0000

description:
Add wskbd_hotkey_deregister() to match wskbd_hotkey_register().

XXX: This is kind of futile; the only user of the wskbd(4)'s hotkey interface
     is hpqlb(4), which is a questionable driver, being, by design,
     limited only to the laptop model for which the driver was written.

diffstat:

 sys/dev/wscons/wskbd.c    |  19 +++++++++++++++++--
 sys/dev/wscons/wskbdvar.h |   3 ++-
 2 files changed, 19 insertions(+), 3 deletions(-)

diffs (62 lines):

diff -r e8a70078f68c -r 9ff7bee2fcc5 sys/dev/wscons/wskbd.c
--- a/sys/dev/wscons/wskbd.c    Tue Oct 26 04:37:33 2010 +0000
+++ b/sys/dev/wscons/wskbd.c    Tue Oct 26 05:12:34 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wskbd.c,v 1.129 2010/07/01 14:49:34 ahoka Exp $ */
+/* $NetBSD: wskbd.c,v 1.130 2010/10/26 05:12:34 jruoho Exp $ */
 
 /*
  * Copyright (c) 1996, 1997 Christopher G. Demetriou.  All rights reserved.
@@ -105,7 +105,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wskbd.c,v 1.129 2010/07/01 14:49:34 ahoka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wskbd.c,v 1.130 2010/10/26 05:12:34 jruoho Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -1653,11 +1653,26 @@
 {
        struct wskbd_softc *sc = device_private(self);
 
+       KASSERT(sc != NULL);
+       KASSERT(hotkey != NULL);
+
        sc->sc_hotkey = hotkey;
        sc->sc_hotkeycookie = cookie;
+
        return sc->sc_base.me_dv;
 }
 
+void
+wskbd_hotkey_deregister(device_t self)
+{
+       struct wskbd_softc *sc = device_private(self);
+
+       KASSERT(sc != NULL);
+
+       sc->sc_hotkey = NULL;
+       sc->sc_hotkeycookie = NULL;
+}
+
 static int
 wskbd_translate(struct wskbd_internal *id, u_int type, int value)
 {
diff -r e8a70078f68c -r 9ff7bee2fcc5 sys/dev/wscons/wskbdvar.h
--- a/sys/dev/wscons/wskbdvar.h Tue Oct 26 04:37:33 2010 +0000
+++ b/sys/dev/wscons/wskbdvar.h Tue Oct 26 05:12:34 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wskbdvar.h,v 1.16 2008/05/01 20:18:19 cegger Exp $ */
+/* $NetBSD: wskbdvar.h,v 1.17 2010/10/26 05:12:34 jruoho Exp $ */
 
 /*
  * Copyright (c) 1996, 1997 Christopher G. Demetriou.  All rights reserved.
@@ -100,6 +100,7 @@
 typedef int (wskbd_hotkey_plugin)(struct wskbd_softc *, void *, u_int, int);
 
 device_t wskbd_hotkey_register(device_t, void *, wskbd_hotkey_plugin *);
+void    wskbd_hotkey_deregister(device_t);
 
 /*
  * Console interface.



Home | Main Index | Thread Index | Old Index