Module Name:    src
Committed By:   dyoung
Date:           Thu Nov 12 19:50:01 UTC 2009

Modified Files:
        src/sys/dev/usb: uaudio.c

Log Message:
Simplify activation hook.  (sc_dying must die!)

s/device_ptr_t/device_t/.


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/sys/dev/usb/uaudio.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/usb/uaudio.c
diff -u src/sys/dev/usb/uaudio.c:1.116 src/sys/dev/usb/uaudio.c:1.117
--- src/sys/dev/usb/uaudio.c:1.116	Wed Sep 23 19:07:19 2009
+++ src/sys/dev/usb/uaudio.c	Thu Nov 12 19:50:01 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: uaudio.c,v 1.116 2009/09/23 19:07:19 plunky Exp $	*/
+/*	$NetBSD: uaudio.c,v 1.117 2009/11/12 19:50:01 dyoung Exp $	*/
 
 /*
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.116 2009/09/23 19:07:19 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.117 2009/11/12 19:50:01 dyoung Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -173,7 +173,7 @@
 	int		sc_mode;	/* play/record capability */
 	struct mixerctl *sc_ctls;	/* mixer controls */
 	int		sc_nctls;	/* # of mixer controls */
-	device_ptr_t	sc_audiodev;
+	device_t	sc_audiodev;
 	struct audio_format *sc_formats;
 	int		sc_nformats;
 	struct audio_encoding_set *sc_encodings;
@@ -471,24 +471,17 @@
 }
 
 int
-uaudio_activate(device_ptr_t self, enum devact act)
+uaudio_activate(device_t self, enum devact act)
 {
-	struct uaudio_softc *sc;
-	int rv;
+	struct uaudio_softc *sc = device_private(self);
 
-	sc = device_private(self);
-	rv = 0;
 	switch (act) {
-	case DVACT_ACTIVATE:
-		return EOPNOTSUPP;
-
 	case DVACT_DEACTIVATE:
-		if (sc->sc_audiodev != NULL)
-			rv = config_deactivate(sc->sc_audiodev);
 		sc->sc_dying = 1;
-		break;
+		return 0;
+	default:
+		return EOPNOTSUPP;
 	}
-	return rv;
 }
 
 void

Reply via email to