Module Name: src Committed By: dyoung Date: Sun Dec 6 23:18:37 UTC 2009
Modified Files: src/sys/dev/ic: mb86950.c mb86960.c smc91cxx.c Log Message: Simplify device-activation hooks. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/dev/ic/mb86950.c cvs rdiff -u -r1.74 -r1.75 src/sys/dev/ic/mb86960.c cvs rdiff -u -r1.75 -r1.76 src/sys/dev/ic/smc91cxx.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/ic/mb86950.c diff -u src/sys/dev/ic/mb86950.c:1.15 src/sys/dev/ic/mb86950.c:1.16 --- src/sys/dev/ic/mb86950.c:1.15 Tue May 12 14:25:17 2009 +++ src/sys/dev/ic/mb86950.c Sun Dec 6 23:18:37 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: mb86950.c,v 1.15 2009/05/12 14:25:17 cegger Exp $ */ +/* $NetBSD: mb86950.c,v 1.16 2009/12/06 23:18:37 dyoung Exp $ */ /* * All Rights Reserved, Copyright (C) Fujitsu Limited 1995 @@ -67,7 +67,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mb86950.c,v 1.15 2009/05/12 14:25:17 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mb86950.c,v 1.16 2009/12/06 23:18:37 dyoung Exp $"); /* * Device driver for Fujitsu mb86950 based Ethernet cards. @@ -965,22 +965,15 @@ int mb86950_activate(device_t self, enum devact act) { - struct mb86950_softc *sc = (struct mb86950_softc *)self; - int rv, s; + struct mb86950_softc *sc = device_private(self); - rv = 0; - s = splnet(); switch (act) { - case DVACT_ACTIVATE: - rv = EOPNOTSUPP; - break; - case DVACT_DEACTIVATE: if_deactivate(&sc->sc_ec.ec_if); - break; + return 0; + default: + return EOPNOTSUPP; } - splx(s); - return (rv); } /* Index: src/sys/dev/ic/mb86960.c diff -u src/sys/dev/ic/mb86960.c:1.74 src/sys/dev/ic/mb86960.c:1.75 --- src/sys/dev/ic/mb86960.c:1.74 Sat Sep 12 19:55:29 2009 +++ src/sys/dev/ic/mb86960.c Sun Dec 6 23:18:37 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: mb86960.c,v 1.74 2009/09/12 19:55:29 tsutsui Exp $ */ +/* $NetBSD: mb86960.c,v 1.75 2009/12/06 23:18:37 dyoung Exp $ */ /* * All Rights Reserved, Copyright (C) Fujitsu Limited 1995 @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mb86960.c,v 1.74 2009/09/12 19:55:29 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mb86960.c,v 1.75 2009/12/06 23:18:37 dyoung Exp $"); /* * Device driver for Fujitsu MB86960A/MB86965A based Ethernet cards. @@ -1802,22 +1802,15 @@ int mb86960_activate(device_t self, enum devact act) { - struct mb86960_softc *sc = (struct mb86960_softc *)self; - int rv, s; + struct mb86960_softc *sc = device_private(self); - rv = 0; - s = splnet(); switch (act) { - case DVACT_ACTIVATE: - rv = EOPNOTSUPP; - break; - case DVACT_DEACTIVATE: if_deactivate(&sc->sc_ec.ec_if); - break; + return 0; + default: + return EOPNOTSUPP; } - splx(s); - return rv; } /* Index: src/sys/dev/ic/smc91cxx.c diff -u src/sys/dev/ic/smc91cxx.c:1.75 src/sys/dev/ic/smc91cxx.c:1.76 --- src/sys/dev/ic/smc91cxx.c:1.75 Tue May 12 14:25:18 2009 +++ src/sys/dev/ic/smc91cxx.c Sun Dec 6 23:18:37 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: smc91cxx.c,v 1.75 2009/05/12 14:25:18 cegger Exp $ */ +/* $NetBSD: smc91cxx.c,v 1.76 2009/12/06 23:18:37 dyoung Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: smc91cxx.c,v 1.75 2009/05/12 14:25:18 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: smc91cxx.c,v 1.76 2009/12/06 23:18:37 dyoung Exp $"); #include "opt_inet.h" #include "bpfilter.h" @@ -1509,21 +1509,15 @@ int smc91cxx_activate(device_t self, enum devact act) { - struct smc91cxx_softc *sc = (struct smc91cxx_softc *)self; - int rv = 0, s; + struct smc91cxx_softc *sc = device_private(self); - s = splnet(); switch (act) { - case DVACT_ACTIVATE: - rv = EOPNOTSUPP; - break; - case DVACT_DEACTIVATE: if_deactivate(&sc->sc_ec.ec_if); - break; + return 0; + default: + return EOPNOTSUPP; } - splx(s); - return (rv); } int