Module Name:    src
Committed By:   plunky
Date:           Thu Apr  5 16:31:53 UTC 2012

Modified Files:
        src/sys/dev/usb: if_cdce.c ubt.c uhso.c

Log Message:
no need to device_pmf_is_registered() before unregister


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/usb/if_cdce.c
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/usb/ubt.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/usb/uhso.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/usb/if_cdce.c
diff -u src/sys/dev/usb/if_cdce.c:1.36 src/sys/dev/usb/if_cdce.c:1.37
--- src/sys/dev/usb/if_cdce.c:1.36	Fri Feb 24 06:48:24 2012
+++ src/sys/dev/usb/if_cdce.c	Thu Apr  5 16:31:53 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_cdce.c,v 1.36 2012/02/24 06:48:24 mrg Exp $ */
+/*	$NetBSD: if_cdce.c,v 1.37 2012/04/05 16:31:53 plunky Exp $ */
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul <[email protected]>
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.36 2012/02/24 06:48:24 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.37 2012/04/05 16:31:53 plunky Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -309,8 +309,7 @@ cdce_detach(device_t self, int flags)
 	struct ifnet	*ifp = GET_IFP(sc);
 	int		 s;
 
-	if (device_pmf_is_registered(self))
-		pmf_device_deregister(self);
+	pmf_device_deregister(self);
 
 	s = splusb();
 

Index: src/sys/dev/usb/ubt.c
diff -u src/sys/dev/usb/ubt.c:1.45 src/sys/dev/usb/ubt.c:1.46
--- src/sys/dev/usb/ubt.c:1.45	Tue Mar  6 03:35:29 2012
+++ src/sys/dev/usb/ubt.c	Thu Apr  5 16:31:53 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ubt.c,v 1.45 2012/03/06 03:35:29 mrg Exp $	*/
+/*	$NetBSD: ubt.c,v 1.46 2012/04/05 16:31:53 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ubt.c,v 1.45 2012/03/06 03:35:29 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ubt.c,v 1.46 2012/04/05 16:31:53 plunky Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -533,8 +533,10 @@ ubt_attach(device_t parent, device_t sel
 	}
 
 	sc->sc_ok = 1;
+
 	if (!pmf_device_register(self, NULL, NULL))
 		aprint_error_dev(self, "couldn't establish power handler\n");
+
 	return;
 }
 
@@ -546,8 +548,7 @@ ubt_detach(device_t self, int flags)
 
 	DPRINTF("sc=%p flags=%d\n", sc, flags);
 
-	if (device_pmf_is_registered(self))
-		pmf_device_deregister(self);
+	pmf_device_deregister(self);
 
 	sc->sc_dying = 1;
 

Index: src/sys/dev/usb/uhso.c
diff -u src/sys/dev/usb/uhso.c:1.8 src/sys/dev/usb/uhso.c:1.9
--- src/sys/dev/usb/uhso.c:1.8	Tue Mar  6 03:35:29 2012
+++ src/sys/dev/usb/uhso.c	Thu Apr  5 16:31:53 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uhso.c,v 1.8 2012/03/06 03:35:29 mrg Exp $	*/
+/*	$NetBSD: uhso.c,v 1.9 2012/04/05 16:31:53 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2009 Iain Hibbert
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhso.c,v 1.8 2012/03/06 03:35:29 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhso.c,v 1.9 2012/04/05 16:31:53 plunky Exp $");
 
 #include "opt_inet.h"
 
@@ -537,8 +537,7 @@ uhso_detach(device_t self, int flags)
 	unsigned int i;
 	int s;
 
-	if (device_pmf_is_registered(self))
-		pmf_device_deregister(self);
+	pmf_device_deregister(self);
 
 	for (i = 0; i < UHSO_PORT_MAX; i++) {
 		hp = sc->sc_port[i];

Reply via email to