Module Name:    src
Committed By:   drochner
Date:           Sun Apr 11 14:04:10 UTC 2010

Modified Files:
        src/sys/dev/wscons: wsdisplay.c

Log Message:
add just as much "detach" code to keep the box from panicking on
removal of a USB "udl" device
(needs more work, but I got the hardware for a quick test only)


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 src/sys/dev/wscons/wsdisplay.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/wscons/wsdisplay.c
diff -u src/sys/dev/wscons/wsdisplay.c:1.132 src/sys/dev/wscons/wsdisplay.c:1.133
--- src/sys/dev/wscons/wsdisplay.c:1.132	Thu Mar 11 04:00:36 2010
+++ src/sys/dev/wscons/wsdisplay.c	Sun Apr 11 14:04:10 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: wsdisplay.c,v 1.132 2010/03/11 04:00:36 mrg Exp $ */
+/* $NetBSD: wsdisplay.c,v 1.133 2010/04/11 14:04:10 drochner Exp $ */
 
 /*
  * Copyright (c) 1996, 1997 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.132 2010/03/11 04:00:36 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.133 2010/04/11 14:04:10 drochner Exp $");
 
 #include "opt_wsdisplay_compat.h"
 #include "opt_wsmsgattrs.h"
@@ -166,12 +166,13 @@
 /* Autoconfiguration definitions. */
 static int wsdisplay_emul_match(device_t , cfdata_t, void *);
 static void wsdisplay_emul_attach(device_t, device_t, void *);
+static int wsdisplay_emul_detach(device_t, int);
 static int wsdisplay_noemul_match(device_t, cfdata_t, void *);
 static void wsdisplay_noemul_attach(device_t, device_t, void *);
 static bool wsdisplay_suspend(device_t, const pmf_qual_t *);
 
 CFATTACH_DECL_NEW(wsdisplay_emul, sizeof (struct wsdisplay_softc),
-    wsdisplay_emul_match, wsdisplay_emul_attach, NULL, NULL);
+    wsdisplay_emul_match, wsdisplay_emul_attach, wsdisplay_emul_detach, NULL);
   
 CFATTACH_DECL_NEW(wsdisplay_noemul, sizeof (struct wsdisplay_softc),
     wsdisplay_noemul_match, wsdisplay_noemul_attach, NULL, NULL);
@@ -588,6 +589,16 @@
 }
 
 int
+wsdisplay_emul_detach(device_t dev, int how)
+{
+	struct wsdisplay_softc *sc = device_private(dev);
+
+	cv_destroy(&sc->sc_flagscv);
+	mutex_destroy(&sc->sc_flagsmtx);
+	return 0;
+}
+
+int
 wsdisplay_noemul_match(device_t parent, cfdata_t match, void *aux)
 {
 #if 0 /* -Wunused */

Reply via email to