Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/onewire Simplify device-activation hooks.
details: https://anonhg.NetBSD.org/src/rev/7b3c59675aa8
branches: trunk
changeset: 749738:7b3c59675aa8
user: dyoung <dyoung%NetBSD.org@localhost>
date: Sun Dec 06 22:49:48 2009 +0000
description:
Simplify device-activation hooks.
diffstat:
sys/dev/onewire/onewire.c | 15 +++++----------
sys/dev/onewire/owtemp.c | 12 +++++-------
2 files changed, 10 insertions(+), 17 deletions(-)
diffs (77 lines):
diff -r da3bd81245ec -r 7b3c59675aa8 sys/dev/onewire/onewire.c
--- a/sys/dev/onewire/onewire.c Sun Dec 06 22:48:17 2009 +0000
+++ b/sys/dev/onewire/onewire.c Sun Dec 06 22:49:48 2009 +0000
@@ -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
diff -r da3bd81245ec -r 7b3c59675aa8 sys/dev/onewire/owtemp.c
--- a/sys/dev/onewire/owtemp.c Sun Dec 06 22:48:17 2009 +0000
+++ b/sys/dev/onewire/owtemp.c Sun Dec 06 22:49:48 2009 +0000
@@ -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
Home |
Main Index |
Thread Index |
Old Index