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 just as much "detach" code to keep the bo...
details: https://anonhg.NetBSD.org/src/rev/3f404b7d5eae
branches: trunk
changeset: 753830:3f404b7d5eae
user: drochner <drochner%NetBSD.org@localhost>
date: Sun Apr 11 14:04:10 2010 +0000
description:
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)
diffstat:
sys/dev/wscons/wsdisplay.c | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
diffs (50 lines):
diff -r 111d97f0f33c -r 3f404b7d5eae sys/dev/wscons/wsdisplay.c
--- a/sys/dev/wscons/wsdisplay.c Sun Apr 11 13:58:30 2010 +0000
+++ b/sys/dev/wscons/wsdisplay.c Sun Apr 11 14:04:10 2010 +0000
@@ -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 */
Home |
Main Index |
Thread Index |
Old Index