Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Simplify activation hook. (sc_dying must die!)



details:   https://anonhg.NetBSD.org/src/rev/d8164ad80014
branches:  trunk
changeset: 748995:d8164ad80014
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Thu Nov 12 19:50:01 2009 +0000

description:
Simplify activation hook.  (sc_dying must die!)

s/device_ptr_t/device_t/.

diffstat:

 sys/dev/usb/uaudio.c |  25 +++++++++----------------
 1 files changed, 9 insertions(+), 16 deletions(-)

diffs (58 lines):

diff -r 03c62ef20ab4 -r d8164ad80014 sys/dev/usb/uaudio.c
--- a/sys/dev/usb/uaudio.c      Thu Nov 12 19:49:03 2009 +0000
+++ b/sys/dev/usb/uaudio.c      Thu Nov 12 19:50:01 2009 +0000
@@ -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:
+       case DVACT_DEACTIVATE:
+               sc->sc_dying = 1;
+               return 0;
+       default:
                return EOPNOTSUPP;
-
-       case DVACT_DEACTIVATE:
-               if (sc->sc_audiodev != NULL)
-                       rv = config_deactivate(sc->sc_audiodev);
-               sc->sc_dying = 1;
-               break;
        }
-       return rv;
 }
 
 void



Home | Main Index | Thread Index | Old Index