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 the device activation routine.



details:   https://anonhg.NetBSD.org/src/rev/821e562bf261
branches:  trunk
changeset: 749492:821e562bf261
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Tue Dec 01 01:05:23 2009 +0000

description:
Simplify the device activation routine.

diffstat:

 sys/dev/ic/cs89x0.c |  17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)

diffs (41 lines):

diff -r 38d732a93da3 -r 821e562bf261 sys/dev/ic/cs89x0.c
--- a/sys/dev/ic/cs89x0.c       Tue Dec 01 01:03:54 2009 +0000
+++ b/sys/dev/ic/cs89x0.c       Tue Dec 01 01:05:23 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cs89x0.c,v 1.28 2009/09/22 16:44:08 tsutsui Exp $      */
+/*     $NetBSD: cs89x0.c,v 1.29 2009/12/01 01:05:23 dyoung Exp $       */
 
 /*
  * Copyright (c) 2004 Christopher Gilbert
@@ -212,7 +212,7 @@
 */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cs89x0.c,v 1.28 2009/09/22 16:44:08 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cs89x0.c,v 1.29 2009/12/01 01:05:23 dyoung Exp $");
 
 #include "opt_inet.h"
 
@@ -2198,19 +2198,12 @@
 cs_activate(device_t self, enum devact act)
 {
        struct cs_softc *sc = device_private(self);
-       int s, error = 0;
 
-       s = splnet();
        switch (act) {
-       case DVACT_ACTIVATE:
-               error = EOPNOTSUPP;
-               break;
-
        case DVACT_DEACTIVATE:
                if_deactivate(&sc->sc_ethercom.ec_if);
-               break;
+               return 0;
+       default:
+               return EOPNOTSUPP;
        }
-       splx(s);
-
-       return error;
 }



Home | Main Index | Thread Index | Old Index