From d061cb2faa5d75a5f587c59992805dcb370978aa Mon Sep 17 00:00:00 2001 From: dyoung Date: Thu, 12 Nov 2009 19:35:59 +0000 Subject: [PATCH] Simplify activation hook. --- sys/dev/ic/sl811hs.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/sys/dev/ic/sl811hs.c b/sys/dev/ic/sl811hs.c index d36b9abc9037..9ee430c274ba 100644 --- a/sys/dev/ic/sl811hs.c +++ b/sys/dev/ic/sl811hs.c @@ -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 -__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 #include @@ -1231,19 +1231,15 @@ slhci_detach(struct slhci_softc *sc, int flags) int slhci_activate(device_t self, enum devact act) { - struct slhci_softc *sc; + struct slhci_softc *sc = device_private(self); - sc = device_private(self); - - if (act != DVACT_DEACTIVATE) - return EOPNOTSUPP; - - slhci_lock_call(sc, &slhci_halt, NULL, NULL); - - if (sc->sc_child) - return config_deactivate(sc->sc_child); - else + switch (act) { + case DVACT_DEACTIVATE: + slhci_lock_call(sc, &slhci_halt, NULL, NULL); return 0; + default: + return EOPNOTSUPP; + } } void