Module Name:    src
Committed By:   dyoung
Date:           Sun Dec  6 22:49:48 UTC 2009

Modified Files:
        src/sys/dev/onewire: onewire.c owtemp.c

Log Message:
Simplify device-activation hooks.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/onewire/onewire.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/onewire/owtemp.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/onewire/onewire.c
diff -u src/sys/dev/onewire/onewire.c:1.12 src/sys/dev/onewire/onewire.c:1.13
--- src/sys/dev/onewire/onewire.c:1.12	Tue May 12 14:39:51 2009
+++ src/sys/dev/onewire/onewire.c	Sun Dec  6 22:49:48 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: onewire.c,v 1.12 2009/05/12 14:39:51 cegger Exp $ */
+/* $NetBSD: onewire.c,v 1.13 2009/12/06 22:49:48 dyoung Exp $ */
 /*	$OpenBSD: onewire.c,v 1.1 2006/03/04 16:27:03 grange Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: onewire.c,v 1.12 2009/05/12 14:39:51 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: onewire.c,v 1.13 2009/12/06 22:49:48 dyoung Exp $");
 
 /*
  * 1-Wire bus driver.
@@ -135,19 +135,14 @@
 onewire_activate(device_t self, enum devact act)
 {
 	struct onewire_softc *sc = device_private(self);
-	int rv = 0;
 
 	switch (act) {
-	case DVACT_ACTIVATE:
-		rv = EOPNOTSUPP;
-		break;
 	case DVACT_DEACTIVATE:
 		sc->sc_dying = 1;
-		break;
+		return 0;
+	default:
+		return EOPNOTSUPP;
 	}
-
-	//return (config_activate_children(self, act));
-	return rv;
 }
 
 int

Index: src/sys/dev/onewire/owtemp.c
diff -u src/sys/dev/onewire/owtemp.c:1.14 src/sys/dev/onewire/owtemp.c:1.15
--- src/sys/dev/onewire/owtemp.c:1.14	Mon May  5 13:58:58 2008
+++ src/sys/dev/onewire/owtemp.c	Sun Dec  6 22:49:48 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: owtemp.c,v 1.14 2008/05/05 13:58:58 xtraeme Exp $ */
+/*	$NetBSD: owtemp.c,v 1.15 2009/12/06 22:49:48 dyoung Exp $ */
 /*	$OpenBSD: owtemp.c,v 1.1 2006/03/04 16:27:03 grange Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: owtemp.c,v 1.14 2008/05/05 13:58:58 xtraeme Exp $");
+__KERNEL_RCSID(0, "$NetBSD: owtemp.c,v 1.15 2009/12/06 22:49:48 dyoung Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -143,14 +143,12 @@
 	struct owtemp_softc *sc = device_private(self);
 
 	switch (act) {
-	case DVACT_ACTIVATE:
-		return (EOPNOTSUPP);
 	case DVACT_DEACTIVATE:
 		sc->sc_dying = 1;
-		break;
+		return 0;
+	default:
+		return EOPNOTSUPP;
 	}
-
-	return (0);
 }
 
 static void

Reply via email to