Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Simplify activation hook.



details:   https://anonhg.NetBSD.org/src/rev/1bd2b755ddeb
branches:  trunk
changeset: 748988:1bd2b755ddeb
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Thu Nov 12 19:35:59 2009 +0000

description:
Simplify activation hook.

diffstat:

 sys/dev/ic/sl811hs.c |  24 ++++++++++--------------
 1 files changed, 10 insertions(+), 14 deletions(-)

diffs (46 lines):

diff -r 84b3a67a09be -r 1bd2b755ddeb sys/dev/ic/sl811hs.c
--- a/sys/dev/ic/sl811hs.c      Thu Nov 12 19:32:14 2009 +0000
+++ b/sys/dev/ic/sl811hs.c      Thu Nov 12 19:35:59 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sl811hs.c,v 1.23 2009/05/12 14:25:18 cegger Exp $      */
+/*     $NetBSD: sl811hs.c,v 1.24 2009/11/12 19:35:59 dyoung Exp $      */
 
 /*
  * Not (c) 2007 Matthew Orgass
@@ -86,7 +86,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sl811hs.c,v 1.23 2009/05/12 14:25:18 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sl811hs.c,v 1.24 2009/11/12 19:35:59 dyoung Exp $");
 
 #include <sys/cdefs.h>
 #include <sys/param.h>
@@ -1231,19 +1231,15 @@
 int
 slhci_activate(device_t self, enum devact act)
 {
-       struct slhci_softc *sc;
-
-       sc = device_private(self);
-
-       if (act != DVACT_DEACTIVATE)
+       struct slhci_softc *sc = device_private(self);
+
+       switch (act) {
+       case DVACT_DEACTIVATE:
+               slhci_lock_call(sc, &slhci_halt, NULL, NULL);
+               return 0;
+       default:
                return EOPNOTSUPP;
-
-       slhci_lock_call(sc, &slhci_halt, NULL, NULL);
-
-       if (sc->sc_child)
-               return config_deactivate(sc->sc_child);
-       else
-               return 0;
+       }
 }
 
 void



Home | Main Index | Thread Index | Old Index